mIRC Home    About    Download    Register    News    Help

Print Thread
#229135 22/01/11 03:27 AM
Joined: Jan 2011
Posts: 14
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2011
Posts: 14
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.

csylvain #229139 22/01/11 07:46 AM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
$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>)


I am SReject
My Stuff
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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).


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #229145 22/01/11 11:51 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

hixxy #229147 22/01/11 12:58 PM
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
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.

Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
Originally Posted By: FroggieDaFrog
$UTCtime - returns the UTC Time in the same format $asctime


This already exists in the form of $gmt(format).

drum #229153 22/01/11 01:56 PM
Joined: Jan 2011
Posts: 14
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2011
Posts: 14
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.

csylvain #229158 22/01/11 04:18 PM
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
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.

drum #229160 22/01/11 05:27 PM
Joined: Jan 2011
Posts: 14
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jan 2011
Posts: 14
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

csylvain #229166 22/01/11 08:11 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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*.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard