Re: Filling in a struct timespec with the current date?
Re: Filling in a struct timespec with the current date?
- Subject: Re: Filling in a struct timespec with the current date?
- From: Esteban Bodigami <email@hidden>
- Date: Tue, 28 Jul 2009 23:06:59 -0600
Eli Bach
<email@hidden>
On Jul 28, 2009, at 9:08 PM, Esteban Bodigami wrote:
i want the time in kilosecs...
Well, first you need to define what you mean by 'time in kilosecs'.
If you're ok with the time from Jan 1, 1970, you can use gettimeofday().
If it's from some other date/time, you need to calculate the difference between Jan 1, 1970 and the date you want, perhaps taking the current time zone into account. There are a variety of functions available to do this kind of calculation.
Once you have that, you just need to multiple that value by 1000.
Eli
1 kilosec = 1 day
1 kilosec != 1000 sec
...which is weird... you may think that you just multiply the seconds to minutes and then to hours and finally to days... but NO!
> one day has never had 24 hours (1440)... it is like 24 hours + 1 minute (1500), because of many astronomical cycles that were never taken into account when the 365 Gregorian Calendar was invented.
for simplicity we have also the "megasec", which will be 1 year, and the "zetasec" which is 1 galactic year (the Mayan Calendar in this way is superior; they knew about the galactic year which equals 26,000 years).
btw, for conversion of time i don't use "seconds" i use "units of time"... which are related to pixies (COLORS and LIGHT); because people cann't see either nano-pixies nor zeta-pixies (they are part of what has being proved by science to be outside of the range of human visible light)... one "light-second" is 300k -1m; but 1 unit of time = 3z units of lenght (almost meters).
the time zone is irrelevant, it is UTC +0
I am fine with the epoch being 1970, because if you -40 there is 1930 (Great Depresion) and if you +40 there is 2010 (next year, 2 years before the 13th baktun and the year 2555 of the Buddhist Era... there will be a year 2600 B.E. btw =)
--
Esteban Bodigami Vincenzi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden