[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: date calculation from Excel 1900 Format

Subject: Re: date calculation from Excel 1900 Format
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Mon, 11 Jun 2001 20:07:46 -0700 (PDT)
excel date algorithm
Hi, Goetz:

  Thanks for the offer to help, much appreciated.
  I could not seems to find an established algorithm
to derive date from the "1900 format", I would be much
appreciate if anyone has seen one.
  The way I thought I might want to approach it (if I
need to build my own) would be:
Assume t as total number of dates since 1/1/1900
1. find divisor and remainder of t/(366+365+365+365). 
This is scope t down to a 4-years span including a
leap year.
2. with the remainder, minus 366,365,365,365 in that
order until result is negative, that scopes t to a
particular year.
3. with the last positive remainder, remove number of
days from each month starting with 31 days in Jan. to
scope t into a particular month, and eventually
particular day within the month.
  As you can see, it is not pretty, and not completely
correct.  The correct way to count leap year is 1 in
every 4, except every 100 and include every 400.  But
I only care recent days and therefore this minor
mistake can be ignored.
  Is there any simpler algorithm?

Much thanks,
Xiaocun



--- Goetz Bock <bock@xxxxxxxxxxx> wrote:
> 
> On Mon, Jun 11 '01 at 11:50, Xiaocun Xu wrote:
> >   Has anyone did date conversion calculation, esp.
> > Excel 1900 format, with XSL?
> Do you happen to have a conversion algorithm in any
> other programming
> language, or even an informal description?
> 
> I don't have the time to search the web for a
> conversion algorithm, but
> I will help you to transfer it to XSLT.
> 
>     Goetz.
> 

> ATTACHMENT part 2 application/pgp-signature 



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.