Solved

ASP Date YYYY-MM-DD

Posted on 2011-09-29
2
382 Views
Last Modified: 2012-05-12
Hi Experts,
How could I display today's date on my classic ASP page in the following format:
YYYY-MM-DD
I'd appreciate your help.
0
Comment
Question by:baxtalo
2 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 500 total points
ID: 36819037
Please see this article:

http://classicasp.aspfaq.com/date-time-routines-manipulation/can-i-make-vbscript-format-dates-for-me.html

<%
   Function pd(n, totalDigits)
        if totalDigits > len(n) then
            pd = String(totalDigits-len(n),"0") & n
        else
            pd = n
        end if
    End Function

    response.write YEAR(Date()) & _
        "-" & Pd(Month(date()),2) & _
        "-" & Pd(DAY(date()),2)
%>
0
 

Author Closing Comment

by:baxtalo
ID: 36830455
Thank you very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
migrate from classic ASP to C# .NET 5 69
Table header not displaying on Firefox and Chrome 7 139
Summernote and form validation 10 97
Question about ASP Including Files 6 42
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now