Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: day of week TimeDayofWeek
There are a lot of different definitions of exactly what is a julian date.
Definition: A Julian representation is simply a count of days since some fixed day in the past.
Originally, I think we started counting from Jan 1 1900, but with the change we started from Jan 1 0000, adding about 730000 days to the number.
;This example grabs the Time/Day of the Week. a=TimeYmdHms() b=TimeJulianDay(a) c=(b+5) mod 7 day=ItemExtract(c+1, "Sun Mon Tue Wed Thu Fri Sat", " ") line=StrCat("Julian Date-> ", b,@CRLF,"Day of week-> ",day) Message(TimeDate(), line)
If you want to determine what day of the week a specific date is, you would substitute the exact date for the "a" variable, as in:
;This example grabs the Time/Day of the Week. a="96:04:12:15:24:00" ; where this is the date for which you want the day of week b=TimeJulianDay(a) c=(b+5) mod 7 day=ItemExtract(c+1, "Sun Mon Tue Wed Thu Fri Sat", " ") line=StrCat("Julian Date-> ", b,@CRLF,"Day of week-> ",day) Message(TimeDate(), line)This example show how to get day Julian date, Day of Year and Day of Week:
ToDate=TimeYmdHms() ThisYear=ItemExtract(1,ToDate,":") JanFirst="%thisyear%:01:01:00:00:00" JanFirstJulian=TimeJulianDay(JanFirst) ToJulian=TimeJulianDay(ToDate) dayofyear=ToJulian-JanFirstJulian+1 dayofweekcode=(ToJulian+5) mod 7 day=ItemExtract(dayofweekcode+1, "Sun Mon Tue Wed Thu Fri Sat", " ") line=StrCat("Julian Date-> ", ToJulian,@CRLF,"Day of Year->",DayofYear,@CRLF,"Day of week-> ",day) Message(TimeDate(), line)
Article ID: W13876
Filename: Obtain the Julian day of year and week.txt
File Created: 2002:04:10:12:44:14
Last Updated: 2002:04:10:12:44:14