zimmer9
asked on
How would you to get a variable named "filenm" to be assigned a value with the trailing value of YYYYMMDD.HHMMSS in a C# console application?
I am developing a C# console application using VS2010.
Do you know how I could get a variable named "filenm" to be assigned the value:
HARRIS.HARRIS.PAECN10.PAEC N10.YYYYMM DD.HHMMMSS such that
YYYYMMDD would be replaced with the: 4 digit year + 2 digit month + 2 digit date of month
HHMMSS would be replaced with the [hours, minutes, seconds]
Do you know how I could get a variable named "filenm" to be assigned the value:
HARRIS.HARRIS.PAECN10.PAEC
YYYYMMDD would be replaced with the: 4 digit year + 2 digit month + 2 digit date of month
HHMMSS would be replaced with the [hours, minutes, seconds]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Output is like:
20131107.081854
Hours "HH" should be capital because it will print in 24-hours format. "hh" prints in 12-hours format.