TimestampToDate & DateToTimestamp
Hello, Unix Timestamps for beginners For those who are not familliar with Unix Timestamps, take a look at Wikipedia (press the link). Introduction Today, I'll present one of my new works: TimestampToDate. This library is able to convert your specified timestamp to a date. - Timezone supported. - Leap years supported. - Easy to use The syntaxes are as followed: Explanation
stock TimestampToDate(Timestamp, &year, &month, &day, &hour, &minute, &second, HourGMT, MinuteGMT = 0)
Notice the last two parameters. GMT is the timezone in which we live. It's taken as the standard timezone. You should only fill in MinuteGMT if you live in a timezone which has for example: 6.5. The year, month, day, hour, minute and second parameters should be filled in like you do in getdate and gettime. Since v2.0, this library contains a new stock: DateToTimestamp. I will explain this as well.
stock DateToTimestamp(str[11])
You could compare this with strtotime/mktime in PHP. The only parameter is a string, which is the date that should be converted to a timestamp. It should be in the following format: 06.04.2013. The "." here is the splitter. It can be changed to any character you wish (as long as you don't use numeric characters, it will probably work). It should be changed by redefining "#SPLITTER" after including this library. Download v2.0 --> [Protected content] Example --> [Protected content] Instalation - Open the link and press RAW. - Copy all text and save it right here: "server_dir/pawno/includes" under filename: TimestampToDate.inc. - Add "#include <TimestampToDate>" in the script you'd like to use it (gamemode?).