WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

TimeJultoymd problem

Keywords:   TimeJultoymd Julian YMDHMS off one day

Question:

I noticed a problem in the conversion of a Julian date using TimeJultoMDY(julian-date). It gives back an answer that is one day off.

0000:07:15:00:00:00=TimeJultoymd(197) the correct conversion is 0000:07:16:00:00:00

Answer:

Incorrect use of the function. You are asking for the date of the 197th day of the year zero, not anything in recent times. About 2000 years ago.

I think you might want...

now=TimeYmdHms()
year=ItemExtract(1,now,":")
jan1="%year%:01:01:00:00:00"

julian=TimeJulianDay(jan1)

julian=julian -1 + 197

day197=TimeJultoYmd(julian)

Message("",day197)

Part of the confusing is multiple definitions for "julian". In some cases there is an "abbreviated" Julian with is day of year (but what year). WinBatch uses something more like the day count since Jan 1 0000.


Article ID:   W14311
Filename:   TimeJultoymd problem.txt
File Created: 2001:01:09:11:33:10
Last Updated: 2001:01:09:11:33:10