Last post Sep 04, 2014 11:30 AM by jayakumarvinayagam
Sep 04, 2014 08:09 AM|Shibly|LINK
I want to convert my date yyyy-mm-dd to yyyymmdd and time hh:mm:ss to hhmmss and both concatenate like yyymmddThhmmss. Can any one please help me. If you given your example using a function then it would be very helpful for me. Thanks in advance.
Sep 04, 2014 08:17 AM|MetalAsp.Net|LINK
Simple, as long as you have a DateTime object. You can use: date.ToString("yyyyMMddhhmmss"). Here "date" is a DateTime object...
Sep 04, 2014 08:20 AM|AidyF|LINK
Do you actually have DateTime objects or do you only have strings with things like "2014-09-04" in them?
Sep 04, 2014 11:30 AM|jayakumarvinayagam|LINK
use ToString() for that,
yyyy - full Year => 2014
yy - current year => 14
MM - month
dd - date
HH - hour
mm - minutes
ss - seconds
please make sure MM and mm are completely different.
i hope it could help you.