- Posts: 217
- Thank you received: 4
How to convert datetime to database's format
- FilipHradil
-
Topic Author
- Offline
Less
More
7 years 5 months ago #305840
by FilipHradil
How to convert datetime to database's format was created by FilipHradil
-- HikaShop version -- : 4.0.3
Hello,
I am trying to connect Hikashop (mysql) to 3rd party SaaS software to be able to generate coupons automatically.
Only problem I have is that I would need to convert date time (for example DD/MM/YYYY HH:MM) to format that is stored in Hikashop database: for example: 1455449220
Please, what is the formula? What logic is there?
Thank you very much in advance,
Filip
Hello,
I am trying to connect Hikashop (mysql) to 3rd party SaaS software to be able to generate coupons automatically.
Only problem I have is that I would need to convert date time (for example DD/MM/YYYY HH:MM) to format that is stored in Hikashop database: for example: 1455449220
Please, what is the formula? What logic is there?
Thank you very much in advance,
Filip
Please Log in or Create an account to join the conversation.
7 years 5 months ago #305841
by nicolas
Replied by nicolas on topic How to convert datetime to database's format
Hi,
It is a unix timestamp:
www.unixtimestamp.com/
In PHP, you have many functions to handle dates and unix timestamps:
www.php.net/manual/en/function.strtotime.php
www.php.net/manual/en/function.strftime.php
In MySQL, you also have functions to convert them directly in the conditions of the MySQL queries or for the results:
stackoverflow.com/questions/11133760/mys...me-to-unix-timestamp
It is a unix timestamp:
www.unixtimestamp.com/
In PHP, you have many functions to handle dates and unix timestamps:
www.php.net/manual/en/function.strtotime.php
www.php.net/manual/en/function.strftime.php
In MySQL, you also have functions to convert them directly in the conditions of the MySQL queries or for the results:
stackoverflow.com/questions/11133760/mys...me-to-unix-timestamp
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
Less
More
- Posts: 217
- Thank you received: 4
7 years 5 months ago #305855
by FilipHradil
Replied by FilipHradil on topic How to convert datetime to database's format
Thank you very much! That helped a lot!
Please Log in or Create an account to join the conversation.
Time to create page: 0.200 seconds