# datetime in generated class?

**URL:** <https://www.dolibarr.org/forum/t/datetime-in-generated-class/6355>\
**Category:** Developing for Dolibarr\
**Created:** [December 18, 2009, 3:36pm UTC](https://www.dolibarr.org/forum/t/datetime-in-generated-class/6355 "2009-12-18T15:36:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalleanka](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/k/fbc32d/32.png) [@kalleanka](https://www.dolibarr.org/forum/u/kalleanka)\
**Post date:** [December 18, 2009, 3:36pm UTC](https://www.dolibarr.org/forum/t/datetime-in-generated-class/6355/1 "2009-12-18T15:36:49Z")

</div>

Hi,

and thank you to all developers for a fantastic software.

I am developing a module. I have a problem with the auto generated classes with /dev/skeleton/build\_class\_from\_table.php. The problem is how to use the generated code from the sql type datetime.

As I can see in the class:

$this-\>db-\>idate($this-\>mydate) for create, INSERT INTO

$this-\>db-\>jdate($obj-\>mydate) for fetch, SELECT

$this-\>db-\>idate($this-\>mydate) for update, UPDATE

So in what format shall the input and output of the dates be? mydate above.

I could rewrite the class file but i wish to keep it as it is generated if i need to regenerate it.

Thanks in advance and any response is welcome.

---

<div class="post-metadata">

**Author:** ![eldy](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/eldy/32/12_2.png) [@eldy](https://www.dolibarr.org/forum/u/eldy)\
**Post date:** [December 30, 2009, 3:33pm UTC](https://www.dolibarr.org/forum/t/datetime-in-generated-class/6355/2 "2009-12-30T15:33:40Z")

</div>

$this-\>mydate must contains a GMT universal timestamp.

Same than result of command mktime() for example.

---

<div class="post-metadata">

**Author:** ![kalleanka](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/k/fbc32d/32.png) [@kalleanka](https://www.dolibarr.org/forum/u/kalleanka)\
**Post date:** [February 8, 2010, 8:43am UTC](https://www.dolibarr.org/forum/t/datetime-in-generated-class/6355/3 "2010-02-08T08:43:15Z")

</div>

Thanks,

mktime() works fine.As understand dol\_mktime() is used for windows compability.
