May be I overlooked it in the manual, but can I create a date with a giving year, month and date.
I have to calculate the date using 0001/01/01 and the number of days since 0001/01/01.
Something like:
AD_Year = function("0001:01:01")
AddDays = "0000:00:%NumberOfdays%:00:00:00"
RealDate=TimeAdd(AD_Year, AddDays)
Suggestions how to do this are appreciated.
best regards, jan Willem Teunisse from the Netherlands
; Use the current date to get days for this example.
Now = TimeYmdHms()
Days = TimeDiffDays(Now, '0001:01:01:00:00:00')
AddDays ='0000:00:':Days:':00:00:00'
NewTime = TimeAdd('0001:01:01:00:00:00', AddDays)
Message('Now ':Now, 'Calculated ':NewTime)
exit
Why not something as simple as [and, of course, hours/minutes/seconds could be added]
month = '12'
day = '13'
year = '2014'
vtDate = ObjectType("DATE","%month%/%day%/%year%") ;or whatever order, delineator used
Message("your date",vtDate)
It is more efficient to manually encode the base date if it is a constant. However, if the base data is not a constant, using ObjectType is a good option. The function does not support a lot of date formats but it does support the conventional forwardslash format.
Thanks for your support, January First, year 1 A.D. is a constant, so I used that example of TD