# Dates

**URL:** <https://forum.kirupa.com/t/dates/288945>\
**Category:** Uncategorized\
**Created:** [May 23, 2009, 6:30pm UTC](https://forum.kirupa.com/t/dates/288945 "2009-05-23T18:30:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![philsbury](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@philsbury](https://forum.kirupa.com/u/philsbury)\
**Post date:** [May 23, 2009, 6:30pm UTC](https://forum.kirupa.com/t/dates/288945/1 "2009-05-23T18:30:32Z")

</div>

Hi,

I’ve been using mktime() to put dates in a database from a form then format then when pulling the out again using date(). This is working fine when I test it on my local server, but when I upload it to the real server the dates are a day early.

the code to make then date is:

```php
	$date = mktime(0, 0, 0, $_POST['month'], $_POST['day'], $_POST['year']);

```

I’m uk based if that makes a difference - on whicj note, I’ve also tried gmmktime, but it seems to give me the same result. Is there a better way of doing this, or is there a way to get this to work properly?

Thanks  
Phil
