[Skip to main content](#vessel-content)

#   How to convert datetime to database's format

##

- **[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")**
- [![FilipHradil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36153-filiphradil "View FilipHradil's Profile") Topic Author
- [ Offline](/forum/user/36153-filiphradil)

Less More

- Posts: 217
- Thank you received: 4
-
-

7 years 7 months ago [\#305840](#305840) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  *[How to convert datetime to database's format](/forum/30-integrations/897326-how-to-convert-datetime-to-databases-format#305840 "-- 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")* was created by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")*

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84OTczMjYtaG93LXRvLWNvbnZlcnQtZGF0ZXRpbWUtdG8tZGF0YWJhc2VzLWZvcm1hdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

7 years 7 months ago [\#305841](#305841) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to convert datetime to database's format](/forum/30-integrations/897326-how-to-convert-datetime-to-databases-format#305841 "-- 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")*

Hi,

It is a unix timestamp:
[ www.unixtimestamp.com/](https://www.unixtimestamp.com/)
In PHP, you have many functions to handle dates and unix timestamps:
[ www.php.net/manual/en/function.strtotime.php](https://www.php.net/manual/en/function.strtotime.php)
[ www.php.net/manual/en/function.strftime.php](https://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](https://stackoverflow.com/questions/11133760/mysql-convert-datetime-to-unix-timestamp)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84OTczMjYtaG93LXRvLWNvbnZlcnQtZGF0ZXRpbWUtdG8tZGF0YWJhc2VzLWZvcm1hdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")**
- [![FilipHradil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36153-filiphradil "View FilipHradil's Profile") Topic Author
- [ Offline](/forum/user/36153-filiphradil)

Less More

- Posts: 217
- Thank you received: 4
-
-

7 years 7 months ago [\#305855](#305855) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[How to convert datetime to database's format](/forum/30-integrations/897326-how-to-convert-datetime-to-databases-format#305855 "-- 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")*

Thank you very much! That helped a lot!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84OTczMjYtaG93LXRvLWNvbnZlcnQtZGF0ZXRpbWUtdG8tZGF0YWJhc2VzLWZvcm1hdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.042 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
