flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
What resolution should the time ticks be? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Total Votes : 8 |
Author |
|
Octavio 22 Sep 2006, 12:04
Adam Kachwalla wrote: I want to convert the number of Seconds (eg. 1039182) from 1/1/1600 0:00:00 to a date (eg. 3/1/2000 19:20:10). Can anyone tell me how to do this (Yes: I have been scouring the net for more than 2 weeks) See timestamp function in Fasm for Dos source code. |
|||
![]() |
|
revolution 22 Sep 2006, 12:11
Windows uses a resolution of 100ns (10 million ticks per second) and uses 64 bits variables to keep the current time. Thus giving up to ~30000 years until overflow into 2^63. Windows also uses the same epoch you mention.
As for the algorithm, you can use such constants as 146097 days in each 400 year section, 1461 days in each 4 year section. Remember that each 100 years has no leap day except years divisible by 400 that do have the normal leap day. I don't have a ready made alogrithm but I think it should be quite simple to construct as a programming exercise. Aside: time periods over 400 years have never been defined. So calculation based on the above may become meaningless as the clock shifts a little bit each 400 year cycle, ie. in the future some time there might be a day here and there added/deleted to keep in sync. Although, this is probably mostly academic since we all will most probably be long dead before such actions are required. |
|||
![]() |
|
Niels 22 Sep 2006, 12:43
The amount of segments in a day, depends on needs.
![]() |
|||
![]() |
|
YONG 23 Sep 2006, 07:02
revolution wrote: Although, this is probably mostly academic since we all will most probably be long dead before such actions are required. We will, of course, be dead by then, but our FASM programs may live forever! ![]() YONG |
|||
![]() |
|
Niels 23 Sep 2006, 13:55
@YONG, you mean dead like this
![]() useR org 0xDEAD Life_Start: db 'Buzz Lightyear',0 call Heaven jmp Life_Start |
|||
![]() |
|
Vasilev Vjacheslav 23 Sep 2006, 15:04
Adam Kachwalla, try to use google for finding julian to gregorian and gregorian to julian time conversion (this comes from unix AFAIK)
|
|||
![]() |
|
Niels 23 Sep 2006, 16:10
|
|||
![]() |
|
Niels 23 Sep 2006, 16:13
|
|||
![]() |
|
Niels 23 Sep 2006, 16:18
http://www.timeanddate.com/date/leapyear.html
Quote: None of the calendars used today are perfect, they go wrong by seconds, minutes, hours or days every year. |
|||
![]() |
|
Niels 23 Sep 2006, 16:21
Time is an agreement.
![]() |
|||
![]() |
|
YONG 25 Sep 2006, 13:02
Niels wrote: @YONG, you mean dead like this Well, I said "LIVE forever", not "RUN forever"! ![]() YONG |
|||
![]() |
|
Niels 25 Sep 2006, 18:58
@YONG, Who knows? (GOD does)
![]() http://www.mcmanis.com/chuck/robotics/projects/lab-x3/lcd1.html Quote: Lack of divide makes it more difficult but we can do it the old fashioned way, subtracting |
|||
![]() |
|
YONG 26 Sep 2006, 12:34
Niels wrote: @YONG, Who knows? (GOD does) Perhaps. But I believe in atheism! ![]() YONG |
|||
![]() |
|
shoorick 26 Sep 2006, 13:38
YONG 永?
|
|||
![]() |
|
Niels 26 Sep 2006, 14:47
@YONG, I would be too, if GOD's name were Atheis.
![]() But atheism is the longest path to meet GOD. |
|||
![]() |
|
Niels 26 Sep 2006, 14:52
For the record: Atheism is not a or the path to k'no'w GOD.
![]() |
|||
![]() |
|
smiddy 27 Sep 2006, 04:00
Adam Kachwalla wrote: I want to convert the number of Seconds (eg. 1039182) from 1/1/1600 0:00:00 to a date (eg. 3/1/2000 19:20:10). Can anyone tell me how to do this (Yes: I have been scouring the net for more than 2 weeks) Hi, My suggestion is to look up Julian Algorithms and Gregorian Calendar. I found several sites with the math to do nearly what you want. I am using the epoch of Julian Day 0 of Monday, January 1, 4713 BC. This is essentially what is used for astronomical calculations for events. I used the FPU to do the calculation I needed. If you want I can share, but I need a few days to clean it up, it is pretty ugly and not ready for prime time. |
|||
![]() |
|
YONG 27 Sep 2006, 12:29
shoorick wrote: YONG 永? @shoorick: YES and NO. YES: "yong" is the Putonghua (Mandarin) pronunciation of the Chinese word "永". NO: I'm a Hongkonger. My native language is Cantonese. "YONG" is the Cantonese pronunciation of a different Chinese word, which is just another strange word to you since you're not familiar with the Chinese Language - so I'm not going to talk about it. ![]() Niels wrote: For the record: Atheism is not a or the path to k'no'w GOD. @Niels: I respect your view. ![]() YONG |
|||
![]() |
|
Niels 27 Sep 2006, 19:37
@YONG, Ok, let's us forget the sidetrack and continue on Adam's subject.
![]() |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.