mIRC Home    About    Download    Register    News    Help

Print Thread
$ctime doesnt read $asctime's 't' (a/p) #223545 28/07/10 06:11 AM
Joined: Jul 2010
Posts: 8
A
arthoz Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jul 2010
Posts: 8
Try it out for yourselves:

$asctime(dd/mm/yyyy hh:nntt)
$ctime(28/07/2010 08:06am) = 1280297160
$ctime(28/07/2010 08:06pm) = 1280340360

$asctime(dd/mm/yyyy hh:nnt)
$ctime(28/07/2010 08:06a) = 1280297160
$ctime(28/07/2010 08:06p) = 1280297160 - should be 1280340360

Re: $ctime doesnt read $asctime's 't' (a/p) [Re: arthoz] #223546 28/07/10 07:30 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
While I can confirm the report regarding the recognition (or lack thereof) of the p character.

The resulting times (in seconds) that you are reporting differ from the results that I got by a period of 6 hours.

Specifically, the results I'm getting show to be 6 hours later than the results that you posted.

Re: $ctime doesnt read $asctime's 't' (a/p) [Re: RusselB] #223547 28/07/10 08:13 AM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
that's because $asctime() takes timezone into account :P


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Re: $ctime doesnt read $asctime's 't' (a/p) [Re: jaytea] #223548 28/07/10 08:34 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: jaytea
that's because $asctime() takes timezone into account :P

Though if he's seeing a time 6 hours *later* and RusselB is in Ontario as his signature claims, then the poster *must* be located on an island like Samoa. :P

Re: $ctime doesnt read $asctime's 't' (a/p) [Re: 5618] #223571 29/07/10 02:59 AM
Joined: Aug 2006
Posts: 183
T
Thrull Offline
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Six hours later puts him somewhere in Europe. Since his signature says he's from Norway, it checks out.


Yar
Re: $ctime doesnt read $asctime's 't' (a/p) [Re: arthoz] #224039 04/08/10 04:01 PM
Joined: Dec 2002
Posts: 4,954
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,954
Thanks, this has been fixed for the next version. This change requires a slightly stricter input format, since the letters 'a' and 'p' might overlap with letters in month names or other text. In the next version, a/p/am/pm will only be accepted if 1) they are at the end of a time value, eg. 08:06am, or 2) if they are a single word separate from all other text. If you think this might be an issue in terms of backwards compatibility please let me know.