Date and Time question

  • Thread starter Thread starter JoeP
  • Start date Start date
J

JoeP

Hi all,

I have the below code for sending e-mail:
oMailMessage.Subject = Now.Date.ToString() & " " & Now.DayOfWeek.ToString() & " XYZ"
From some reason the time portion of the Date shows all the time the 12.00:00 AM instead of the real time.

Any idea?

Thanks,

Joe
 
Use

Now.ToString() instead of Now.Date.ToString()

Now.Date creates a new DateTime object based oin the current DateTime, but
without the time part
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

Hi all,

I have the below code for sending e-mail:
oMailMessage.Subject = Now.Date.ToString() & " " & Now.DayOfWeek.ToString()
& " XYZ"
From some reason the time portion of the Date shows all the time the
12.00:00 AM instead of the real time.
Any idea?
Thanks,
Joe
 
Back
Top