This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

today time in unixtime

Help for those learning Tcl or writing their own scripts.
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

today time in unixtime

Post by whittinghamj »

hi guys, herre is an interesting one, been bugging for hours over this

i need to find out what the unixtime stamp is for todays date at 00:00:00 / 12:00 am

set today [clock scan [clock format [unixtime] -format "%m-%d-%y" -gmt no]]

does not seem to work it reutnrs a value that is in the future for some reason - quite ALOT in the future actually

(05:43:12) (Quest) set today [clock scan [clock format [unixtime] -format "%m-%d-%y" -gmt no]]
(05:43:13) (@PHX-GOD) Quest: #71 (20382 clicks) Tcl: 1233957600

any help would be great - cheers
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

clock scan 09/03/2007
This should get the unixtime of September 3, 2007 at 12:00 a.m.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Or, for "today";

Code: Select all

clock scan "today 00:00:00"
NML_375
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Heres the full format, just FYI:
#Format specifiers:
#----------------------------------------------------
# %%: Insert an '%'
# %a: Abbreviated weekday name (Mon, Tue, etc)
# %A: Full weekday name (Monday, Tuesday, etc)
# %b: Abbreviated month name (Jan, Feb, etc)
# %B: Full month name (January, February, etc)
# %c: Locale specific date and time
# %d: Day of month (01 - 31)
# %H: Hour in 24-hour format (00 - 23)
# %I: Hour in 12-hour format (00 - 12)
# %j: Day of year (001 - 366)
# %m: Month number (01 - 12)
# %M: Minute (00 - 59)
# %p: AM/PM indicator
# %S: Seconds (00 - 59)
# %w: Weekday number (Sunday = 0)
# %W: Week of year (01 - 52)
# %x: Locale specific date format
# %X: Locale specific time format
# %y: Year without century (00 - 99)
# %Y: Year with century (e.g: 1990)
# %Z: Time zone name
#----------------------------------------------------
#Additional specifiers:
# %D: Date as %m/%d/%y (e.g: 04/08/05)
# %e: Day of month (1 - 31), no leading zeros
# %h: Abbreviated month name (Jan, Feb, etc)
# %n: Insert a new line
# %r: Time as %I:%M:%S %p
# %R: Time as %H:%M
# %t: Insert a tab
# %T: Time as %H:%M:%S
#-------------------------------------------------------

Code: Select all

set tformat "%a, %d %b %Y @ %r"
set date [clock format [clock seconds] -format $tformat]
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply