Re: Number of days since 1/1/0001
Re: Number of days since 1/1/0001
- Subject: Re: Number of days since 1/1/0001
- From: Matthew Smith <email@hidden>
- Date: Sat, 24 Nov 2001 10:48:35 +1100
on 24/11/01 09:54, ehsan saffari at email@hidden wrote:
>
Given any date, I need to figure out the number of days that have passed
>
since January 1, 0001, (730811 days for 23/11/2001)
>
>
This should be easy with a simple date subtraction but AS simply refuses
>
to accept a date with a year less than 1000.
>
>
set {dd, mm, yyyy} to {1,1,1}
>
set temp to date ("" & dd & "/" & mm & "/" & yyyy)
>
--> date "Monday, January 01, 2001 00:00:00" ^!*%^@
>
>
any ideas?
It seems you can't enter a date directly with a year below 1000. It assumes
you want it to be 2000 + the value. You can use another date and subtract
the known days difference to get the value.
Set theDate to date "23/11/2001" - 730811 * days
It seems strange to want to go back that far anyway. The calculations would
be incorrect. We have changed the calendar system several times between 1
january 0001 and now.
--
Matthew Smith