Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP Date YYYY-MM-DD

Posted on 2011-09-29
2
Medium Priority
?
398 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

886 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