views:

225

answers:

3

I am trying to split a string from a recordset that is in the format DD/MM/YYYY.

So basically something like:

Homework.Fields.Item("DateDue").Value.split("/")

But that doesn't work, Normally I can do:

String(Homework.Fields.Item("DateDue").Value).split("/")

But using String() turns the value into a long thing like:

Wed Oct 26 00:00:00 UTC+0100 2011

Which I can't split.

All I need is the day DD part.

Is there away to bump topics as I still haven't got working answer.

+1  A: 

Maybe you just need to Homework.Fields.Item("DateDue").Value.getDate()

Rubens Farias
+1 for the pragmatic answer :) If the date is the only value needed, then use JavaScript's native `getDate()` function instead of splitting the string and trying to read the appropriate array item.
Russ Cam
A: 

Maybe you need to parse date first from the value before calling getDate()?

DateTime.Parse(Homework.Fields.Item("DateDue").Value).getDate()?

McLovin
It just comes back with:Microsoft JScript runtime error '800a1391''DateTime' is undefined
Jonathan
+1  A: 

Turns out I had to use client side javascript anyway, to get the clients local time. So I just put the Homework....Value into a javascript Variable and it seems to work.

Jonathan