c sharp convert string time into 24 hours time
DateTime dateTime = DateTime.Now;
string strMinFormat = dateTime.ToString("hh:mm:ss tt");//12 hours format
string strMaxFormat = dateTime.ToString("HH:mm:ss tt");//24 hours format
c sharp convert string time into 24 hours time
DateTime dateTime = DateTime.Now;
string strMinFormat = dateTime.ToString("hh:mm:ss tt");//12 hours format
string strMaxFormat = dateTime.ToString("HH:mm:ss tt");//24 hours format
c sharp convert string time into 24 hours time
using System;
namespace Demo {
public class Program {
public static void Main(string[] args) {
DateTime d = DateTime.Parse("05:00 PM");
Console.WriteLine(d.ToString("HH:mm"));
}
}
}
c sharp convert string time into 24 hours time
using System;
class Solution
{
static string timeConversion(string s)
{
return DateTime.Parse(s).ToString("HH:mm");
}
static void Main(string[] args)
{
Console.WriteLine(timeConversion("01:00 PM"));
Console.Read();
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us