In C#, DateTime.ToShortTimeString() returns the time of day as short text, with hours and minutes only. With the invariant culture the text is HH:mm, for example 14:30.
The layout comes from the current culture, and some cultures use a 12-hour clock with AM or PM. The method is the same as ToString("t").
This is an instance member of System.DateTime. You call it on a DateTime value, such as dt.ToShortTimeString(...). DateTime is a struct, so every value is copied and never changed in place.
Syntax
Call it on a DateTime. It takes no arguments.
C#
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
DateTime dt = new DateTime(2026, 11, 18, 14, 30, 45);
string s = dt.ToShortTimeString(); // "14:30"
Call
What it does
dt.ToShortTimeString()
Hours and minutes in the current culture.
dt.ToString("t")
The same result with a format letter.
dt.ToString("HH:mm", culture)
A custom pattern that never changes with the culture.
Seconds are cut off, not rounded. 14:30:59 still shows 14:30.
Library declarations
C#
public string ToShortTimeString();
Parameters
Parameter
Description
None
ToShortTimeString() takes no parameters.
Return Value
Return Value
Description
string
The time in the short time pattern of the current culture. The date and seconds are not included.
C# Examples
Example 1 — Hours and Minutes
Print the short time for an afternoon and a night value.
C#
using System;
using System.Globalization;
class Program {
static void Main() {
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
DateTime afternoon = new DateTime(2026, 11, 18, 14, 30, 45);
DateTime night = new DateTime(2026, 11, 18, 0, 5, 9);
Console.WriteLine(afternoon.ToShortTimeString());
Console.WriteLine(night.ToShortTimeString());
}
}
Output
14:30
00:05
How It Works
Fixed culture. Invariant culture uses a 24-hour clock for the short time.
Seconds removed. The 45 seconds of the first value do not appear.
Leading zeros. The second value prints 00:05, with the zero hour kept.
Midnight. Hour 0 is shown as 00, not as 12.
Example 2 — Seconds Are Cut Off
Show that 59.999 seconds does not round up to the next minute, and match ToString("t").
C#
using System;
using System.Globalization;
class Program {
static void Main() {
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
DateTime t = new DateTime(2026, 11, 18, 14, 30, 59, 999);
Console.WriteLine(t.ToShortTimeString());
Console.WriteLine(t.ToShortTimeString() == t.ToString("t"));
}
}
Output
14:30
True
How It Works
Almost the next minute. The value is 14:30:59.999.
No rounding. The text still says 14:30, because extra parts are simply dropped.
Same as "t". The standard t format gives identical text.
Prints True. Use whichever you find more readable.
Example 3 — A Simple Timetable
Print three time slots from an array of DateTime values.
C#
using System;
using System.Globalization;
class Program {
static void Main() {
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
DateTime[] slots = {
new DateTime(2026, 11, 18, 9, 5, 0),
new DateTime(2026, 11, 18, 13, 45, 0),
new DateTime(2026, 11, 18, 23, 59, 0)
};
foreach (DateTime slot in slots) {
Console.WriteLine(slot.ToShortTimeString());
}
}
}
Output
09:05
13:45
23:59
How It Works
Array initializer. Three DateTime values hold the schedule.
foreach loop. Each value is printed on its own line.
Padded hours. The first slot shows 09:05, with a leading zero.
Date is hidden. Every slot is on November 18, but the output shows only the clock time.
Frequently Asked Questions
Hours and minutes, for example 14:30 in the invariant culture.
Yes. Both use the short time pattern of the current culture.
No. Seconds are dropped, so 14:30:59 still prints 14:30.
Use ToString("HH:mm", CultureInfo.InvariantCulture).
No. Use ToShortDateString or a custom format for the date.