| View previous topic :: View next topic |
| Author |
Message |
whittinghamj Op
Joined: 21 May 2006 Posts: 103
|
Posted: Sun Sep 02, 2007 6:46 am Post subject: today time in unixtime |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Sep 02, 2007 7:20 am Post subject: |
|
|
Try
| Code: | | clock scan 09/03/2007 |
This should get the unixtime of September 3, 2007 at 12:00 a.m. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Sep 02, 2007 6:02 pm Post subject: |
|
|
Or, for "today";
| Code: | | clock scan "today 00:00:00" |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Sep 02, 2007 10:40 pm Post subject: |
|
|
Heres the full format, just FYI:
| Quote: |
#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: |
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.
================================== |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|