Jump to content

[Include] TimestampToDate


Arabu
 Share

Recommended Posts

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 -->

This is the hidden content, please

Example -->
This is the hidden content, please


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?).

 

vldgIri.png

YouTube : Click Redirect Channel

Discord : Arabu#9330

Canal Discord : Click To Join

Facebook : Click Facebook

Instagram : Click Instagram

Skype : Mita.Official

Așteptăm jucatorii de PUBG Mobile și pe serverul de Discord PUBG Mobile România!

Join PUBGM România

Respectă și vei fi respectat !

 

 

 

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
On 6/6/2018 at 3:50 PM, Marlboro said:
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 -->

Hidden Content

  • Reply to this topic to see the hidden content.


Example -->

Hidden Content

  • Reply to this topic to see the hidden 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?).

 

 

gg

Link to comment
Share on other sites

  • 11 months later...
  • 2 weeks later...
  • 3 weeks later...
  • 2 months later...
  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...