date type

Results 1 to 4 of 4

Thread: date type

  1. #1
    cheril Guest

    Default date type

    When I write a=Date & then call a in asp I get the date in the<BR>format mm/dd/yy. now I want it in the format dd/mm/yy. so what do i do? Also if I get it in mm/dd/yy or dd/mm/yy how can I only display the month & date ie dd/mm or mm/dd

  2. #2
    Join Date
    Dec 1969

    Default rtlm

    Look at these functions in the documentation:<BR><BR>month(date)<BR>year(date)<BR >day(date)<BR><BR><BR>e.g. to answer your last question, you could <BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write day(date) & "/" & month(date)

  3. #3
    Sid Guest

    Default RE: date type

    &#060;%<BR>Session.LCID = 2057<BR>%&#062;<BR>That should put the date string into UK format<BR>ie..<BR>02/12/2000

  4. #4
    Join Date
    Dec 1969

    Default RE: date type

    Hi! Cheril<BR><BR> Your problem can be solved very easily using certain functions<BR>available in ASP. U can extract the year, month and day of a date<BR>by using the following functions:<BR> year(date) --- returns year in YYYY format. Store it in a variable and use mid function to select the last 2 characters of the year returned to get year in yy format. For eg.,<BR><BR> dim Year,Month,Day,var1,var2,var3,Mydate<BR> Year=year(date) &#039--- return year in YYYY format<BR> var1=mid(cstr(Year),3,2) &#039---return year in YY format<BR> &#039Similiarly<BR> Month= month(date) &#039--- returns month in mm format<BR> Day=day(date) &#039--- returns day in dd format<BR> Mydate=cstr(Day) & "/" & cstr(Month) & "/" & var1<BR> &#039Now Mydate will contain date in format dd/mm/yy<BR> &#039U can display date using this method in your own chosen <BR> &#039format.<BR><BR>Hope this solves ur prob.<BR><BR>Deb.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts