Date converting in Visual Studio

  • All right, I'm going to try this another way.

    I am using Visual Studio and am having trouble converting time/day from;

    ie. Standard Time = "2/22/2010 8:20:06 PM"

    to Military Time = "2/22/2010 20:20:06 "

    I have been trying to perform this conversion using an Expression for the date field I am converting, but with no luck.

    Can anyone help?

  • declare @MyDate datetime

    select @MyDate = '2/22/2010 8:20:06 PM'

    select @MyDate, CONVERT(varchar,@MyDate, 101) + ' ' + CONVERT(varchar,@MyDate,114)

    Converting oxygen into carbon dioxide, since 1955.
  • Thanks, I really appreciate your help. Works great.

  • Thank you for the feedback.

    Converting oxygen into carbon dioxide, since 1955.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply