mIRC Homepage
Posted By: gomp Altering the time stamps ... - 07/02/08 09:32 AM
When I type: /time .. I get: Thursday February 7 2008 -- 10:24:00 +01:00 .. in status!

When I type: /say $fulldate .. I get: Thu Feb 07 10:24:00 2008 .. in the channel I type it in.

I wonder how could I change the time stamp format? Both of them..

I would like "/time" to give: Thursday 07 February 2008 -- 10:24:00 GMT +01:00

And I would like the "/say $fulldate" to give: Thursday 07 February 2008 - 10:24:00

Anyone know where to find this?
I know how to manage timestamps, but I cannot find where to manage them.
Posted By: Bekar Re: Altering the time stamps ... - 07/02/08 10:44 AM
/time and $fulldate are fixed formats. If you want to play around with the format of a time string, look at $asctime(), i.e.:

Code:
//echo -a $asctime(dddd dd mmmm yyyy -- HH:nn:ss zzz)

See /help $asctime() for the formatting details.
Posted By: Collective Re: Altering the time stamps ... - 07/02/08 10:45 AM
/time is returned in a format chosen by the server. You can catch the response with a raw 391 event.
Posted By: Bekar Re: Altering the time stamps ... - 07/02/08 10:47 AM
Ack! Was thinking $time! smile
Posted By: gomp Re: Altering the time stamps ... - 07/02/08 10:56 AM
So it is not possible to mess with?

I got confused now..
Posted By: Collective Re: Altering the time stamps ... - 07/02/08 12:16 PM
You can't change the output of $fulltime. You can display time in a custom format using $asctime as Bekar described.

/time is returned by the IRC server, you can change the display locally using a raw 391 event.
Posted By: Riamus2 Re: Altering the time stamps ... - 07/02/08 02:21 PM
alias mytime { return $time(dddd dd mmm yyyy -- hh:nn:tt zzz) }
alias myfulldate { return $time(dddd dd mmm yyyy -- hh:nn:tt) }

//say $mytime
//say $myfulldate

Obviously you can rename those to something better. If you want $mytime to work as an alias, change "return" to /say and add a check to make sure that the $active window is either a channel or a query.
Posted By: gomp Re: Altering the time stamps ... - 03/03/08 02:50 PM
Thanks a lot! laugh
© mIRC Discussion Forums