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
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
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
The amount of segments in a day, depends on needs.
![]() |
|||
![]() |
|
YONG
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
@YONG, you mean dead like this
![]() useR org 0xDEAD Life_Start: db 'Buzz Lightyear',0 call Heaven jmp Life_Start |
|||
![]() |
|
Vasilev Vjacheslav
Adam Kachwalla, try to use google for finding julian to gregorian and gregorian to julian time conversion (this comes from unix AFAIK)
|
|||
![]() |
|
Niels
|
|||
![]() |
|
Niels
|
|||
![]() |
|
Niels
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
Time is an agreement.
![]() |
|||
![]() |
|
YONG
Niels wrote: @YONG, you mean dead like this Well, I said "LIVE forever", not "RUN forever"! ![]() YONG |
|||
![]() |
|
Niels
@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
Niels wrote: @YONG, Who knows? (GOD does) Perhaps. But I believe in atheism! ![]() YONG |
|||
![]() |
|
shoorick
YONG 永?
|
|||
![]() |
|
Niels
@YONG, I would be too, if GOD's name were Atheis.
![]() But atheism is the longest path to meet GOD. |
|||
![]() |
|
Niels
For the record: Atheism is not a or the path to k'no'w GOD.
![]() |
|||
![]() |
|
smiddy
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
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
@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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.