Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: 3 digit Day of Year Julian date
I would like to make a little script that would get return the Julian Date based on the date.
Any suggestions?
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)
Also here are some UDfs you can use to determine this type of information
#DefineFunction DayOfYear(ToDate) ThisYear=ItemExtract(1,ToDate,":") JanFirst="%thisyear%:01:01:00:00:00" JanFirstJulian=TimeJulianDay(JanFirst) ToJulian=TimeJulianDay(ToDate) doy=ToJulian-JanFirstJulian+1 return (doy) #EndFunction #DefineFunction DayOfWeek(ToDate) ToJulian=TimeJulianDay(ToDate) dayofweekcode=(ToJulian+5) mod 7 day=ItemExtract(dayofweekcode+1, "Sun Mon Tue Wed Thu Fri Sat", " ") return(day) #endfunction now=TimeYmdHms() doy=DayOfYear(now) dow=DayOfWeek(now) Message(doy,dow) exit
Article ID: W14978
File Created: 2001:11:08:12:41:16
Last Updated: 2001:11:08:12:41:16