![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| hi i want to write a javascript function which take a date in YYYY-MM-DD format and return in CYYMMDD format . where C starts at 0 (meaning 1900-1999) and increments from there. So 2000-2099 would be 1. 3000-3099 would be 2. how to do this .sorry for not posting any code. Thanks a lot
__________________ Love is physical attraction and mental destruction |
| Sponsored Links |
|
#2
| ||||
| ||||
| hi now this is my code Code: function msFormatDate(vsDate)
{
if(vsDate.length > 0)
{
vsDate = vsDate(0).text;
return vsDate.substr(2,2) + vsDate.substr(5,2) + vsDate.substr(8,2) ;
}
else
{
return '';
}
}
thanx |
|
#3
| ||||
| ||||
| Try this:- Code: function msFormatDate(vsDate){
if(vsDate.length > 0){
return Number(vsDate.substr(0,1))-1 + vsDate.substr(2,2) + vsDate.substr(5,2) + vsDate.substr(8,2) ;
}else{
return '';
}
}
|
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Page Number Manipulation | AOG123 | Microsoft Access | 6 | March 20th, 2008 01:38 PM |