Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get time from datetime c#

DateTime dt = DateTime.Parse("6/22/2009 07:00:00 AM");

dt.ToString("HH:mm"); // 07:00 // 24 hour clock // hour is always 2 digits
dt.ToString("hh:mm tt"); // 07:00 AM // 12 hour clock // hour is always 2 digits
dt.ToString("H:mm"); // 7:00 // 24 hour clock
dt.ToString("h:mm tt"); // 7:00 AM // 12 hour clock
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# get last item in list 
Csharp :: unity normalize float 
Csharp :: c# get the last item in a list 
Csharp :: unity create a child object 
Csharp :: how to make an object appear and disappear in unity 
Csharp :: unity on inspector change 
Csharp :: wpf set color in code 
Csharp :: read folder c# 
Csharp :: make window not resizable wpf 
Csharp :: c# remove special characters from string 
Csharp :: print content of array c# 
Csharp :: how to make a mouse down condition in unity 
Csharp :: how to redirect to extern page in .net core 
Csharp :: git find commits by message 
Csharp :: get child of transform by index unity 
Csharp :: unity get child gameobject 
Csharp :: asp.net core 3.1 ajax partial view 
Csharp :: c# initialize empty array 
Csharp :: const class in c sharp 
Csharp :: c# encode jpg hiight quality 
Csharp :: failed to read the request form. missing content-type boundary .net core 
Csharp :: c# console header 
Csharp :: last two characters of string c# 
Csharp :: c# consuming post rest service 
Csharp :: c# calculator 
Csharp :: unity play sound effect 
Csharp :: what is the meaning of ?? in c# 
Csharp :: CS0101 Unity Error Code 
Csharp :: httpcontext in .net standard 
Csharp :: sequelize count all 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =