# Substr

**URL:** <https://forum.kirupa.com/t/substr/234973>\
**Category:** Uncategorized\
**Created:** [August 7, 2007, 3:33pm UTC](https://forum.kirupa.com/t/substr/234973 "2007-08-07T15:33:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [August 7, 2007, 3:33pm UTC](https://forum.kirupa.com/t/substr/234973/1 "2007-08-07T15:33:29Z")

</div>

arrgh, can’t seem to get substr to work properly in this situation. i’m getting

> Sun May 13 00:00:00 GMT-0400 2007  
> back from a query and I want to strip it down to simply say “Sun May 13”.

I’m trying to use:

```auto
var dts:String=rs.getItemAt(i).MediaDate;
		trace("DTS: "+dts);
		dta=dts.substr(1, 6);
		trace("dta: "+dta);

```

to no avail. I get undefined when i try to trace out the substring!

what am i doing wrong???!!!
