mIRC Homepage
Posted By: csylvain UTC timestamps - 22/01/11 03:27 AM
suggest either expanding timestamp formatting or add option for Message and Logging timestamps.

as timestamp format: U and UU in addition to H and HH? Z is already taken. only the displayed hour need be different and UTC is always a 24 hr clock. no AM/PM.

alternatively, provide a checkbox in the IRC Category to have both Message and Log entries use UTC timestamps.
Posted By: FroggieDaFrog Re: UTC timestamps - 22/01/11 07:46 AM
$UTCtime - returns the UTC Time in the same format $asctime
$UTCTime(<format>) - format is the same as $asctime with the addition of U
Code:
alias UTCTime return $asctime($regsubex($iif($1-,$1-,ddd mmm dd UU:nn:ss yyyy),/(UU?)/g,$base($iif($calc($time(H) - $timezone / 3600) > -1,$v1,$calc(24 + $v1)),10,10,$len(\t))))

If wanted I could probably add $UTCTime(<time in seconds>) and $UTCTime(<time in seconds>,<format>)
Posted By: argv0 Re: UTC timestamps - 22/01/11 08:35 AM
Unfortunately it's not possible to insert $identifiers inside the /timestampfmt, so you couldn't actually use this within mIRC without theming every event (and replacing every /echo -t with /echo $utctime).
Posted By: hixxy Re: UTC timestamps - 22/01/11 11:51 AM
There's a much simpler (and probably horribly inefficient) way:

Code:
on *:start: .timertimeupdate -o 0 1 .timestamp -f $!utctime(UU:nn:ss)


Obviously, with this method if you want to use a format which returns a letter (like tt returning am/pm), you will need to put that part outside of the $utctime() call.
Posted By: drum Re: UTC timestamps - 22/01/11 12:58 PM
This should do the trick and is efficient (only changes the timestamp format once per hour on the hour).

Code:
on *:START:updatetimestamp

alias updatetimestamp {
  .timestamp -f $chr(91) $+ $gmt(HH) $+ :nn:ss]
  .timerupdatetimestamp -o $calc(($asctime(H) + 1) % 24) $+ :00 1 0 updatetimestamp
}


I would imagine there would be some quirks to this method though (e.g., messing up on DST changes).

You could also consider a program like this that would make mIRC believe the time was different than your system clock.

By the way, it's not always safe to assume that the minutes are the same between your local timezone and UTC. There are several timezones around the world that are a half hour or even quarter hour offset from the "standard" timezones. Properly dealing with timezones in a computer program can actually be a surprisingly complicated matter.
Posted By: drum Re: UTC timestamps - 22/01/11 01:02 PM
Originally Posted By: FroggieDaFrog
$UTCtime - returns the UTC Time in the same format $asctime


This already exists in the form of $gmt(format).
Posted By: csylvain Re: UTC timestamps - 22/01/11 01:56 PM
RunAsDate injects a _fixed_ timestamp, so that's not at all what I'm suggesting for enhancement.

All those people who pointed out $gmt: thanks, I know about that and can use it in my scripts, but that's not what I'm asking for at all. I'm not looking to generate a timestamp value in UTC.

I'd like to have my timestamps _in channel_ be displayed in UTC and not localtime. Similarly, I'd rather have the timestamps added by logging be in UTC instead of localtime. All present timestamp Alt+O->IRC->Message and Alt+O->IRC->Logging formatting refers to localtime.
Posted By: drum Re: UTC timestamps - 22/01/11 04:18 PM
Originally Posted By: csylvain
I'd like to have my timestamps _in channel_ be displayed in UTC and not localtime. Similarly, I'd rather have the timestamps added by logging be in UTC instead of localtime. All present timestamp Alt+O->IRC->Message and Alt+O->IRC->Logging formatting refers to localtime.


We realize that. We were just trying to give you the closest thing you can get to it in mIRC right now, which although it produces the timestamps you want, it's admittedly more of a sloppy hack than anything and doesn't work properly for everything.

I think what you're asking for would be a good feature. It's reasonable to keep online logs independent of local timezone.
Posted By: csylvain Re: UTC timestamps - 22/01/11 05:27 PM
ok, thanks. i got distracted by the "fake" timestamp link and missed
the info on manipulating /timestamp to my desires.

my "good enough - for now" answer was to put:
timestamp -f $chr(91) $+ $gmt(HH) $+ :nn]
in an "on TEXT" event after examining the suggestions.

(ps: on the topic of suggestions, why doesn't this BBS autowrap/autobreak
message lines when browsing? never used a horiz scrollbar so much before)
:P
Posted By: argv0 Re: UTC timestamps - 22/01/11 08:11 PM
code tags are not wrapped because they can't be. It would be nice if they had a max-width, but this forum software is *old*.
© mIRC Discussion Forums