# Formatting date field

**URL:** <https://forum.kirupa.com/t/formatting-date-field/137229>\
**Category:** Uncategorized\
**Created:** [February 12, 2005, 11:17am UTC](https://forum.kirupa.com/t/formatting-date-field/137229 "2005-02-12T11:17:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![biznuge](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/biznuge/32/11567_2.png) [@biznuge](https://forum.kirupa.com/u/biznuge)\
**Post date:** [February 12, 2005, 11:17am UTC](https://forum.kirupa.com/t/formatting-date-field/137229/1 "2005-02-12T11:17:42Z")

</div>

I’m currently using a datefield compinent to assess a window for customers to have work done. Problem is, automatic e-mails generated by my ASP server page look a little bit shoddy when they are received because of the long format of the selectdate variable return:-

> [font=Tahoma]Mon Feb 7 00:00:00 GMT+0000 2005[/font]

Is there an easy way to perform this formatting or would i need to use a string function to substring the field?

P.S. could someone explain how the hell [color=red]substring[/color] and [color=red]substr[/color] are actually used, cos I’m using:-

```auto
 my_var_to=my_to.substring(1,10); 

```

and it keeps on returning undefined.
