Dear list..... (Notice the nice start) I am in need of some advice.... I am trying to figure out a way to take a specific date and convert it to the unix time. i.e.... 07/15/99 and convert that to the unix time for that specific date lets say at noon. I have pondered this... and am at a lose.... I am talking about the time that started 1/1/70... ( I believe....) thanks in advance..... -- Kirk Moore EPM - Release Management environments - STL's and Training Development 425-965-6543 (desk) 425-797-9092 (pager) Black holes are created when God divides by zero! -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
I believe what you need is mktime(3) (that is, "man 3 mktime"). Read the man pages of the associated functions too. You may be better served if you direct your questions to the Linux C Programming mailing list. Rafael -- PMoraza@aol.com wrote:
I follow this procedure to use gettimeofday() ... 1. #include
and 2. declare timeval and timezone structs ... struct timeval tv; struct timezone tz;
3. pass tv and tz to gettimeofday (look at man gettimeofday) ...
gettimeofday(&tv, &tz);
4. assign the member elements in the timeval struct (from #3) to long variables (or you do whatever else you had in mind) ...
s_sec = tv.tv_sec; s_msec = tv.tv_usec;
linuxCprogramming mailing list linuxCprogramming@i-docs.net http://mail.i-docs.org/mailman/listinfo/linuxcprogramming
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
On Thu, 4 May 2000, EXT-Moore, Kirk W wrote: kw> Dear list..... (Notice the nice start) kw> kw> I am in need of some advice.... I am trying to figure out a way to take a specific date and convert it to the unix time. i.e.... 07/15/99 and convert that to the unix time for that specific date lets say at noon. I have pondered this... and am at a lose.... kw> kw> I am talking about the time that started 1/1/70... ( I believe....) kw> kw> Try, man 1 date, for example: kull@daydream:~ > date --date=07/15/1999 Thu Jul 15 00:00:00 PDT 1999 or kull@daydream:~ > date --date=1/1/70 Thu Jan 1 00:00:00 PST 1970 kw> thanks in advance..... kw> -- S.Toms - tomas@primenet.com - www.primenet.com/~tomas SuSE Linux v6.3+ - Kernel 2.2.14 -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
"EXT-Moore, Kirk W" wrote:
I am in need of some advice.... I am trying to figure out a way to take a specific date and convert it to the unix time. i.e.... 07/15/99 and convert that to the unix time for that specific date lets say at noon. I have pondered this... and am at a lose....
I am talking about the time that started 1/1/70... ( I believe....)
To take the current date/time and output it in 'Unix time': date +%s or to take a certain date (for example midnight on the 6th of May): date -d '6 May 2000' +%s See 'man date' for more information. Hope that helps, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\ -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (4)
-
chris.reeves@iname.com
-
Kirk.Moore@PSS.Boeing.com
-
raffo@neuronet.pitt.edu
-
tomas@primenet.com