# Mysql unix+date stamps etc

**URL:** <https://forum.kirupa.com/t/mysql-unix-date-stamps-etc/290769>\
**Category:** Uncategorized\
**Created:** [June 19, 2009, 11:11am UTC](https://forum.kirupa.com/t/mysql-unix-date-stamps-etc/290769 "2009-06-19T11:11:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patch](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/patch/32/1095_2.png) [@Patch](https://forum.kirupa.com/u/Patch)\
**Post date:** [June 19, 2009, 11:11am UTC](https://forum.kirupa.com/t/mysql-unix-date-stamps-etc/290769/1 "2009-06-19T11:11:57Z")

</div>

Hi,

I need to take a date stamp in the database and convert it in the query to a unix time stamp. is this possible?

The format of the date stamp is i.e ‘d/m/y’ but i need it be in a unix format. Is it possible to do this in the query?

my current query is quite simple:

```php

$sql = "SELECT * FROM job_specs";

```

But I need to do something like:

```php

$sql= "SELECT *, expire AS (unix_time_stamp_thingy) FROM job_specs WHERE unix_time_stamp_thingy = 'current_unix_time_stamp_thingy'";

```

The reason for converting the date to unix is because I need to subtract 10 days from the date and I’m only aware of doing this with unix stamps etc. If someone else has a better method, i’m all ears 🙂

Thanks!
