mIRC Home    About    Download    Register    News    Help

Print Thread
#37221 19/07/03 06:57 PM
S
ScatMan
ScatMan
S
i tried $gmt(1/1/1970 03:00:00) but it returns the "1/1/1970 03:00:00" except returning the CTIME of it, why ?

#37222 19/07/03 07:14 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
I have no idea what you mean here.

#37223 19/07/03 07:18 PM
C
codemastr
codemastr
C
?

#37224 19/07/03 07:23 PM
P
pheonix
pheonix
P
READ THEM LINKS AND FIND THE ANSWER YOURSELF

#37225 19/07/03 07:30 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
One could say the same thing for you, you too are asking questions that can easily be found in the helpfile. Regardless of whether or not the answer can be found there, the use of caps and bold text is inappropriate ...

#37226 19/07/03 07:55 PM
Joined: Feb 2003
Posts: 2,737
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,737
For once I have to side with pheonix. Scat-Man is being extremely irritating lately, and refuses to accept the answers given to him... so he resorts to cross-posting here.

Read his original thread on the Developer Forum.

Yes, the subject line is different (by one letter), but he's still trying to trick people into explaining how World Time works without taking the initiative to read the resources he was referred to.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#37227 19/07/03 08:11 PM
Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
Well that certainly was an interesting read smile Rarely encounter people who are so adamant to be spoonfed an answer instead of reading a tutorial or so for themselves. It's actually the same as with his regex question earlier.

That quote by Confucius sure comes in handy here smile

#37228 19/07/03 08:12 PM
Joined: Dec 2002
Posts: 817
P
Hoopy frood
Offline
Hoopy frood
P
Joined: Dec 2002
Posts: 817
lol - funny thing is, if he'd read the tutorial 2 days ago like was suggested, instead of arguing about it, he'd know the answer by now.

#37229 19/07/03 08:13 PM
P
pheonix
pheonix
P
if he hadnt been ignorant about it neither would i smile
i dont think the answer is in the help file, but he has been told many times by numerous people they wont help him until he looks at the sites provided.

Last edited by pheonix; 19/07/03 08:19 PM.
#37230 19/07/03 08:14 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
$gmt() works exactly like $asctime(), only it returns GMT dates/times instead of dates/times in your timezone. To understand why $gmt() returns the result you mentioned, you need to read carefully how $asctime() works.

Help file:
$asctime(793947600) returns the default text format for this time value
$asctime(hh:nn:ss) returns the current time in this format
$asctime(793947600,dd/mm/yy) returns the date for this time value
.......
Note: You can specify both the N and format parameters, or only one or the other.


As you can see, $asctime() does not accept a date as a parameter: it accepts an integer (taken as seconds elapsed from 1/1/1970 0:00) and returns the date for this number, in the format you specified in the 2nd parameter. What happens if the 1st (secs) parameter is missing? mirc assumes the current $ctime. This means that you can only specify the format param and it returns the current values for H, h, n, s etc. So, $asctime(1/1/1970 03:00:00) or $gmt(1/1/1970 03:00:00) think that the "1/1/1970 03:00:00" part is the format because a simple check tells mirc that it isn't an integer, which would be the seconds; so it must be the format parameter. And since this parameter does not contain any 'evaluatable' items (ie letters H, h, n, s, m, d etc) , $asctime / $gmt return the parameter unaffected.

#37231 20/07/03 11:56 AM
S
ScatMan
ScatMan
S
oh, i thought it works like $ctime()
nevermind
thanks



#37232 20/07/03 12:12 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
Yeah it's a bit of a mess. $gmt works like $ctime, but $gmt() works like $asctime() (notice the ()'s, which indicate that the identifier accepts parameters).


Link Copied to Clipboard