mIRC Homepage
Posted By: ScatMan $ctime - 18/07/03 05:40 AM
Ctime started at the same moment so how is that possible that it is different for every1 that has different timezone from you ??

Posted By: Pasmal Re: $ctime - 18/07/03 06:15 AM
Because each timezone is a different time. In New Zealand, I'm 12 hours ahead of the UK (GMT). ctime/unix epoch started at 01/01/70 12:00:00. So to me, ctime started about 1750wks 1day 6hrs 12mins ago. Because the time is 6:12pm, 18/06/2003. But in the UK, the time is 6:12am, so in the UK, it's only been 1750wks, 18hrs, 12mins (or whatever) since epoch began.

I think that's about right...
Posted By: ScatMan Re: $ctime - 18/07/03 06:28 AM
my timezone is +2 hours from UK
in 1/1/1970 02:00:00 it started counting the ctime here
at the same moment, in UK, it was 00:00:00 and it start counting too
so it seems that until now, the duration here and there was the same
Posted By: KingTomato Re: $ctime - 18/07/03 09:34 AM
to put it in a simple term..
Quote:
Returns total number of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time.


Mainly if you have 5:00 am on your pc, and i have 7:00 am, mine is going to be a whole 2 hrs ((60 * 2) seconds) ahead of your ctime..
Posted By: ScatMan Re: $ctime - 18/07/03 09:39 AM
that "simple term" doesn't help me.. i want to know how it works.. read my second msg

Posted By: Pasmal Re: $ctime - 19/07/03 02:38 AM
Try:

http://www.wikipedia.org/wiki/Unix_epoch (and then http://www.wikipedia.org/wiki/UTC, http://www.wikipedia.org/wiki/Epoch)

And

http://www.google.co.nz/search?hl=en&...y&meta=

Note that the UNIX epoch is based on 00:00:00 UTC on January 1 1970, itself a datetime that doesn't occur at the same instance everywhere in the world.
Posted By: ScatMan Re: $ctime - 19/07/03 06:41 AM
i'm sorry but i can't read it, it is too long..
anyone that already know it can help me ?
i don't need to know all this terms from the tutorial i just need an answer for my question

Posted By: Pasmal Re: $ctime - 19/07/03 08:21 AM
Both my posts gave you information to answer your question.

Just because it is 'too long to read' does not make it an invalid answer. smirk
Posted By: ScatMan Re: $ctime - 19/07/03 10:03 AM
grrrr so can u answer my question here?
read my second post and that's what i can't figure out
Posted By: Hammer Re: $ctime - 19/07/03 10:16 AM
What is so hard to understand? Your local $ctime is simply offset from $gmt by $timezone, plus or minus.Your timezone is GMT +2, so you would be subtracting 7200 seconds (2 hours) from your local $ctime to derive $gmt.
Posted By: Watchdog Re: $ctime - 19/07/03 10:55 AM
Is there a way to convert a time given in a notice back to $ctime?
Posted By: Nobodi Re: $ctime - 19/07/03 11:19 AM
//echo -ag $ctime(January 1 1970 10:00:00) returns 0 for me and should for you in NSW as well.
Posted By: Watchdog Re: $ctime - 19/07/03 12:42 PM
Close... Lets say I get a memo... and this is the "sent at" notice in the memo:

[22:37:07] -MemoServ- [Sent At: 19/07/03 11:39:06 GMT]

What I want to do is change the blue bit to $ctime. I can't find a way or even confirm if it is possible as $ctime isn't supplied by the server in this case. BTW, I have already modified the date to show the proper way, thank Christ for token identifiers lol.
Posted By: ScatMan Re: $ctime - 19/07/03 12:49 PM
yes, but it's not my question
think about it.. if the ctime here and GMT start counting the seconds at the same moment (but the time here and there wasn't the same, +2 hours) so how is that possible that until now it won't be the same ?

Posted By: ScatMan Re: $ctime - 19/07/03 12:55 PM
$ctime(19/07/03 11:39:06)
Posted By: lammkott Re: $ctime - 19/07/03 01:01 PM
Quote:

my timezone is +2 hours from UK
in 1/1/1970 02:00:00 it started counting the ctime here
at the same moment, in UK, it was 00:00:00 and it start counting too
so it seems that until now, the duration here and there was the same


The ctime in your location didn't start at '1/1/1970 02:00:00', it started at 1/1/1970 00:00:00 your local time, so when the ctime in the UK began, your local ctime would have been 2 hour into the count, or 7,200 seconds.
Posted By: Watchdog Re: $ctime - 19/07/03 01:27 PM
Okay thankyou.

With a little playing I came up with this which works beaut:

$time($calc($ctime($3 $4)+36000),HH:nn:ss)

With $3 and $4 equalling the date and time in the memo respectively.
Posted By: ScatMan Re: $ctime - 19/07/03 02:40 PM
aha
what about this
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 ?
Posted By: codemastr Re: $ctime - 19/07/03 02:40 PM
Read the URLS you were given! They answer it, instead of reading it you just basically said "I'm too lazy" well then thats not our problem. We gave you the answer, you didn't want to take the time to read the answer, it's not our job to "dummy it up" for you. If you can't understand it, then it's simple you don't get an answer.
Posted By: ScatMan Re: $ctime - 19/07/03 02:49 PM
i'm not lazy and i'm really don't have time to read such a big tutorial when the answer to my question can be very short so i can understand it




Posted By: pheonix Re: $ctime - 19/07/03 02:51 PM
i had to read an 800+ page on the current http protocol to understand GET HEAD POST. but i can use them with ease now(cept connecting to irc)
if you dont have the time, you dont learn it, simple.
Posted By: codemastr Re: $ctime - 19/07/03 03:00 PM
How do you know the answer to your question is short? If you know that, then you should also know the answer. You have NO idea how long or short the answer is, and in fact it is not all that easy to explain. If you don't want to take the time to read the explanation, then why should I go, read it for you, and then summarize it? Why should I have to do more work because you don't want to?
Posted By: ScatMan Re: $ctime - 19/07/03 05:01 PM
can anyone HELP me ?


Posted By: pheonix Re: $ctime - 19/07/03 05:02 PM
codemastr and pasmal helped you.
Posted By: Raccoon Re: $ctime - 19/07/03 07:51 PM
This is exactly the reason you were banned from #mIRC.

Take some initiative and LEARN from the resources provided to you. Don't expect everything to be dictated for you.

If you must, write a script that reads a webpage for you in a custom @window, and randomly insert people's nicks before each paragraph to make it APPEAR as if we're typing it to you.

(I wrote a nifty WPM delay algorithm that calculates how many seconds it should take to type a line, given the typist's average WPM. I'll even share it with you if need be.)

- Raccoon
Posted By: qwerty Re: $ctime - 19/07/03 10:28 PM
It's odd that this hasn't been mentioned directly by anyone, but what you must understand is that $ctime returns the same value for everyone (if you ignore the difference of a couple of minutes due to inaccurate setting of time on each system). It has no choice but being the same for everybody, since, as you correctly thought, it's the number of seconds elapsed from a certain moment. What differs among people in different countries is $asctime($ctime) but only because it is designed to return the current date/time taking into account your timezone. What is different among users is also $gmt (NOT $gmt()), which is designed in a way that, when fed in $asctime(), returns the current time in Greenwich (GMT). So $gmt actually "makes up" for the difference in the $asctime() of each user. $gmt is equivalent to $calc($ctime + $timezone). In short, $asctime(), $gmt and $timezone vary among users, but $ctime doesn't. I hope it's clearer now.
Posted By: Pasmal Re: $ctime - 20/07/03 08:11 AM
Quote:
$ctime returns the same value for everyone


I thought that at first, too. But then I changed my Time Zone from +12(NZ) to +9:30 (Darwin) and called (within the space of 3-4 seconds of each other) //echo -a $asctime($ctime) from $ctime and got:

Sun Jul 20 20:09:55 2003 from 1058688595
Sun Jul 20 17:40:06 2003 from 1058679606

The difference in ctime values is clearly visible.

Help file description: "Returns total number of seconds elapsed since 00:00:00 GMT, January 1, 1970 based on your system time"
Posted By: qwerty Re: $ctime - 20/07/03 11:07 AM
This is happening for a different reason. Here are some results from //echo -s $asctime($ctime) - $ctime with various timezone settings:
Sun Jul 20 13:51:34 2003 - 1058698294
Sun Jul 20 06:51:54 2003 - 1058698314
Sun Jul 20 16:52:15 2003 - 1058698335
even though $asctime() returns very different dates, $ctime is the same (with a difference of few secs). I guess the difference in $ctime you noticed is because of Daylight Saving Time. If the option "Automatically adjust clock for DST changes" is disabled, I get different values for certain timezones. I didn't check it thoroughly enough, but it seems that countries with timezone offsets that are not integer multiples of an hour make the system return a different $ctime when the option is disabled. In any case, this difference is most of the times 2.5 hours, which is irrevelevant to the actual timezone offset of that country (it can coincide, but has nothing to do with it).
Posted By: ScatMan Re: $ctime - 20/07/03 11:35 AM
ok, i think i understand it now
thx
Posted By: Pasmal Re: $ctime - 21/07/03 07:06 AM
Ah yes it was the DST that confused me, cheers.
© mIRC Discussion Forums