Search code examples
asp-classicjscript

Split a string in ASP Javascript


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.


Solution

  • 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.