|
| ||||||||||
| Tags: asp, date, format, java, script, time |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Format Date and Time Script in ASP
I want to change the formats of the date and time in ASP. Since I have recently started I don't know much about the ASP. I have done that changes but in Java. Anyone out there can tell me what are the Formats of Date and Time Script in ASP..?? Please guide me about the functions that are used for the same..!! Need help as earlier as possible.!! ![]()
__________________ AMD Sempron 2800+ @ 2Ghz Asus A7V8X-LA 120Gb Seagate barracuda 7200Rpm Ultra-ATA 100 Elixir 512mb DDR Pc3200 (Soon 1Gb) Club 3D Radeon 9600 256Mb Lite-On Cd & Dvd writer combo IDE-Dvd drive 400w Psu Windows Xp Pro Sp2 Advent Wireless Mouse & Keyboard. |
|
#2
| ||||
| ||||
| Re: Format Date and Time Script in ASP
If you want to check the Date or Time in ASP, you can use the FormatDateTime(). The inbuild function called FormatDateTime() is very useful for ASP. For getting the current date and time in ASP, you can use the now() function. You can use the code as mentioned below : Code: <% dim todaysDate todaysDate=now() %> |
|
#3
| |||
| |||
| Re: Format Date and Time Script in ASP
I have provided you with some format of Date, just have a look on that : If you want to check today's date then you can use the todaysDate : Code: <% Response.write todaysDate %> Code: RESULT: 2/10/2010 2:09:59 AM Code: <% Response.write FormatDateTime(todaysDate,1) %> Code: RESULT: Wednesday, February 10, 2010 |
|
#4
| |||
| |||
| Re: Format Date and Time Script in ASP
I have tried to give some more examples for checking the weekdays. You can use the following commands for the same : Code: <% = weekday(now) %> If you want to show a name of a day in a week, use the below command : Code: <% = weekdayname(weekday(now)) %> Code: <% = month(now) %> Code: <% = monthname(month(now)) %> |
|
#5
| ||||
| ||||
| Re: Format Date and Time Script in ASP
You can also auto-update the year in ASP. I have provided with a script that can auto-update the year displayed : Code: <% Function CorrectCopyrightYear (CreationYear) If Year(Now) > CreationYear Then CorrectCopyrightYear = CreationYear & "-" & Year(Now) Else CorrectCopyrightYear = CreationYear End If End Function %>
__________________ I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Format Date and Time Script in ASP" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error message: cant login This computer date/time is not synchornize with the date/time of network | fazalhassan | Networking & Security | 2 | 29-11-2011 08:29 AM |
| Date and Time widget does not keep time correctly in Motorola Defy | Sanat | Portable Devices | 8 | 19-10-2011 05:08 AM |
| How to format a huge database in excel 2007 date and time | Dayanidhi | Windows Software | 5 | 06-07-2011 12:05 AM |
| Date & time Conversion PST Pacific Standard Time to GMT | Austinage | Software Development | 2 | 30-07-2009 05:38 PM |
| Date and Time format in a BATCH File | RogerFielden | Software Development | 3 | 20-04-2009 11:47 AM |