• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

ASP.NET / VB: Friendly Date Format

Response.write(Request.Params("expire"))
This has a format like:
11/12/2015

I would like it to be like this:
November 12, 2015
0
hankknight
Asked:
hankknight
3 Solutions
 
CodeCruiserCommented:
Try

Response.write(DateTime.Parse(Request.Params("expire")).ToString("MMM yyyy"))


http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx
0
 
käµfm³d 👽Commented:
I think CodeCruiser's format should be this instead:

ToString("MMMM dd, yyyy")

Open in new window

0
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,

You can use following code,
Just make sure that Request.Params("expire") contains valid date.

Response.Write(Convert.ToDateTime(Request.Params("expire"))).ToString("MMMM dd, yyyy"))

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now