Questions tagged [dayofweek]

Usually a function that returns day of the week when a certain date object is passed.

Get day of day of the week in:

691 questions
-1
votes
2 answers

day of the week issue always prompts monday no matter the entry

The outcome of this is when you enter any number 1-7 you will get the day of that number. for some reason it will always prompt Monday. How can I fix this? '#Enter a number range 1-7 for the day of the week Example 1=Monday #variables to…
-1
votes
1 answer

Getting day of the week, switch statement/toString issues implementation of leap year aswell

I'm working on a little project for school and my group members and I struggling with a few things in our code. We need to write code for determining the day of the week, any given date would be on, we have the code for it, and we are using a switch…
-1
votes
2 answers

How to get start and end of a week of a specific date using xslt?

How to get start and end of a week of a specific date using xslt?
Abdelhameed Mahmoud
  • 2,118
  • 2
  • 22
  • 17
-1
votes
2 answers

Android: Get day of week from selected day

i have use the following code to get day_of_week from selected day, but it is working for 1st 7 days only, can anyone please help me. public DatePickerDialog.OnDateSetListener pickerListener = new DatePickerDialog.OnDateSetListener() { …
Pearl
  • 121
  • 1
  • 8
-1
votes
1 answer

Using the time to retrieve specific content from a database through php

Am trying to display information on a website based on the local time. Each element has 3 elements. 1. A start time from 01 - 24 2. An end time from 00 - 60 3. A day of the week from Mon - Sun What I want to do is load a specific element from the…
Jay Smoke
  • 573
  • 3
  • 13
  • 35
-1
votes
1 answer

Calculation of sum of days in java- android project

I have a non-zero integer value which is the sum of the days of the week where the days have the following values: Sunday = 1 Monday = 2 Tuesday = 4 Wednesday= 8 Thursday = 16 Friday = 32 Saturday = 64 Example: Integer value 127 - All…
-2
votes
1 answer

Python 3.2 UnboundLocalError in Date to Day of the Week converter

Nooby Coder here! My assignment is to code something that prints the day of the week of any given date. My code is working fine but when I run anything that isn't in the correct format (i.e. "//2011" or "12/a/2011") it will give me this error: line…
-2
votes
2 answers

Easy way to get the weekday in a batch file

I was searching for a good easy answer to getting the day of the week from %date% and saw a lot of answers but none very eloquent.
-2
votes
1 answer

Auto-detect the start date and end date to store the day of the week, start time and end time in the day block

I have a problem auto-detecting the start date and end date to store the day of the week, start time, and end time in DayBlock objects. Why do I need to auto-detect? Because startDate and endDate are selected by users. In the future, they cannot be…
Fatt Sky
  • 650
  • 3
  • 11
-2
votes
1 answer

Why getDayOfWeek does not return day number of week?

I have written code to print the day number of week, from 1 - Monday ... I found this: java.time.DayOfWeek num = LocalDate.of(year, month, day).getDayOfWeek(); System.out.println(num); Example output: > FRIDAY So, instead of printing the number,…
Sinkos
  • 33
  • 2
-2
votes
1 answer

Create an array of Strings which are initialized to the 7 days of the week

public class MyClass { public static void main(String args[]) { //Create an array of Strings which are initialized to the 7 days of the week using a while-loop, print all the contents of the array. (do the same for do-while and for loop) String…
-2
votes
2 answers

Can anyone give me a function to calculate date and time in python ? I m in WINDOWS 10

Please can anyone provide me function for time,date & day in python just like time = time() and time = "##:##:##" # is replaced with current time in my laptop And date = date() and date = "####/##/##" And day = day() and day = "sun/mon/tue/wed/etc"
-2
votes
3 answers

How to increment both daysOfWeek and day, check them for overflow and reset as needed

I'm trying to write code that starts with day 1 (and whatever weekday that happens to be) and print out consecutively. For example, if Friday is 1, it should next print Saturday 2, then continue counting the days as normal but reset the dayOfTheWeek…
-2
votes
3 answers

Java LocalDate How to utilize

input list from date ex) 2020-10-01 to date ex) 2020-10-30 List [day of week] ex) [sun,mon....] List [week] ex) [1,4,5] I would like to know how to get a specific day of the week…
sc m
  • 13
  • 2
-2
votes
1 answer

Using switch to change an integer to a string

I need to convert the integer to a string. The integer is a most_occurred_number and I cannot figure out which integer to plug into the code. I have put most_occurred_number as the integer but nothing is changing in the cout. I tried putting…