Jump to content

Days with datetime MySQL and MTA or Lua function


aka Blue

Recommended Posts

Hi everyone! I have a little question about datetime function

I use a MySQL database and I want to know the number of days that have passed.

The format of datetime is: YYYY/MM/DD HH/MM/SS

Is there any function to subtract the days and know how many have passed? In MTA or Lua because I know that exists datediff but i don't want to query all the time

Thanks in advance!

Link to comment
9 hours ago, Pirulax said:

I'd store a simple timestamp, then use getRealTime(timestamp), and there you go

Thanks for answering! Finally I used timestamp but I would like to know how to format the value to receive a date, like...

Timestamp = 15351823012

Function that returns = 12-01-2018...

¿It is possible?

Thanks in advance!

Link to comment

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
  • Recently Browsing   0 members

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