Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2004-09

How to get the milliseconds since January 1, 1900

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Zhong Wang

Hello, everybody

In Java and Java script, a date time can be
converted to the milliseconds since January 1, 1900, and a long integer can be get. Is there a convenient function in FPC to be compatible with Java and
Javascript? I think it's not so easy to convert
TDateTime or TTimeStamp to the milliseconds since
January 1, 1900 in FPC sysutils library.

Help me, thank you so much

Yours,

_________________________________________________________ Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://cn.rd.yahoo.com/mail_cn/tag/yisou/music/*http://music.yisou.com/ 美女明星应有尽有,搜遍美图、艳图和酷图 http://cn.rd.yahoo.com/mail_cn/tag/yisou/image/*http://image.yisou.com 1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

Reply by email

Olle Raab
to Zhong Wang

04-09-02 20.15, skrev Zhong Wang följande:

Show quoted text 10 lines
Hello, everybody In Java and Java script, a date time can be converted to the milliseconds since January 1, 1900, and a long integer can be get. Is there a convenient function in FPC to be compatible with Java and Javascript? I think it's not so easy to convert TDateTime or TTimeStamp to the milliseconds since January 1, 1900 in FPC sysutils library.

Afaik TDateTime is number of days since a certain start year (dont know when). This should be easy to convert to nr of millisecond (guess you need 64 bit int for this). Since TDateTime is Double, it has decimals which describes the fraction of the day.

Olle

Reply by email

Michael Van Canneyt
to Olle Raab
Olle Raab wrote 17 lines
04-09-02 20.15, skrev Zhong Wang f�ljande: > Hello, everybody > > In Java and Java script, a date time can be > converted to the milliseconds since January 1, 1900, > and a long integer can be get. Is there a convenient > function in FPC to be compatible with Java and > Javascript? I think it's not so easy to convert > TDateTime or TTimeStamp to the milliseconds since > January 1, 1900 in FPC sysutils library. > Afaik TDateTime is number of days since a certain start year (dont know when). This should be easy to convert to nr of millisecond (guess you need 64 bit int for this). Since TDateTime is Double, it has decimals which describes the fraction of the day.

Check the dateutils unit, it contains routines to do this.

Michael.

Reply by email