Solved

Data Formatting Expression

Posted on 2004-09-10
8
2,115 Views
Last Modified: 2012-05-05
My project team is currently working on converting a web application from ASP to ASP.NET.  I am working on creating a data grid that shows a reports subject, start time, ID Number etc.  In a field that shows estimated start time I need a particular data format and in two time zones with a line return.  So far all I have is {0:dd MMM}

example:
Input:
September 10, 2004  9:25AM

Output:
10 Sep    0925
10 Sep    1425
0
Comment
Question by:uncommonX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12027016
Expression       Description
{0:C}             Formats the data as a default currency item (ie, $39.95)
{0:D3}             Formats the data as a zero-padded four-character wide number (ie, 0023)
{0:N2}%       Formats the data as a two decimal place number followed by a '%' symbol (ie, 59%)
{0:0.0}       Formats the data as a number, rounding to one decimal place (ie, 36.5)
{0:D}             Formats the data as a long date string (ie, "Thursday, December 25, 2003"; see the following figure)
{0:dd-MM-yy}       Formats the data as a dd-MM-yy date (ie, "20/05/04")
0
 

Author Comment

by:uncommonX
ID: 12027087
I know of those expressions but those are only a few of the actual expressions that I need
0
 
LVL 17

Accepted Solution

by:
AerosSaga earned 250 total points
ID: 12027132
0
Industry Leaders: 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!

 
LVL 8

Expert Comment

by:daffodils
ID: 12028777
0
 
LVL 35

Expert Comment

by:YZlat
ID: 12029119
the closest one is Fri, 10 Sep 2004 13:34:38 GMT

Response.Write(dt.ToString("R") + "<BR>")
0
 
LVL 35

Expert Comment

by:YZlat
ID: 12029159
here is a function that will do that for you:

 Public Function FormatMyDate(ByVal dt As Date) As String
        Dim myDate As String
        myDate = dt.ToString("R")
        myDate = Trim(Right(myDate, myDate.Length - 4))
        myDate = Trim(Left(myDate, myDate.Length - 7))
        myDate = Replace(myDate, ":", "")
        FormatMyDate = myDate
    End Function
0
 

Author Comment

by:uncommonX
ID: 12029646
Thanks AerosSaga, the links you gave me got me the correct information:
{0:dd MMM HHmm}C <br> {0:dd MMM HHmm}Z

The time zone stuff will be a function utilizing the ToLocalTime function built into VB
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12029675
glad I could be of some assistance;)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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