Tinderbox Forum

Setting dates without timing

Hi, I’m wondering how is it possible to insert a format date without timing. Eg. for me is important that such event happened 22/03/65 (or 03/22/65, this is not important and I know how to change it), but not 22/03/65 11:42.


So easy!!!

Thank you very much, PaulWalters …

For later readers I’d just remind them that regardless of how we view it in the app, a Date-type attribute always has a time element.

Even if you never want/need the time element of a Date-type attribute it is always there. Think of it as a Date-Time attribute: there is no Date-without-a-time attribute type! If you don’t want to see the time element, you need to hide it via formatting.

Unless the attribute is going to be used in calculations, or in some other context in which its value as a date or as a time is important, then might be simpler just to use string attributes than date attributes. “23/03/65” has a much meaning as a string as it does as a date-time attribute configured to look like “23/03/65”.

If one occasionally needs $MyString to act like a date, then transform its content with date($MyString).format().

1 Like