Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to add 1 hour to Starttid and Sluttid when using this code, if it is, how do i do that?

C#
string.Format("Hej, Rubrik : {0} Starttid : {1} Sluttid : {2:} Beskrivning : {3}   Mötet bokat av: {4}", Rubrik, Starttid, Sluttid, Beskrivning, LoginName)
Posted
Updated 22-Nov-14 3:15am
v2
Comments
Maciej Los 22-Nov-14 9:15am    
What?
Philippe Mori 22-Nov-14 10:56am    
Why you would need to do that? Store time in UTC and convert them to appropriate local time zone when displaying time.
If you want to add 1 hour for any other reason, then probably that your property should already give the adjusted time anyway. You really don't want to duplicate that logic everywhere in your code.
King Fisher 22-Nov-14 10:56am    
unclear

1 solution

If Starttid and Sluttid is DateTime datatype, you can use AddHours() method[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900