Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 1:13
primem0ver3-Dec-17 1:13 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 1:46
primem0ver3-Dec-17 1:46 
GeneralRe: Async method/task issue Pin
Gerry Schmitz3-Dec-17 3:17
mveGerry Schmitz3-Dec-17 3:17 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 4:03
primem0ver3-Dec-17 4:03 
GeneralRe: Async method/task issue Pin
Gerry Schmitz3-Dec-17 4:41
mveGerry Schmitz3-Dec-17 4:41 
GeneralRe: Async method/task issue Pin
primem0ver4-Dec-17 2:12
primem0ver4-Dec-17 2:12 
GeneralRe: Async method/task issue Pin
Gerry Schmitz4-Dec-17 6:50
mveGerry Schmitz4-Dec-17 6:50 
GeneralRe: Async method/task issue Pin
primem0ver3-Feb-18 23:03
primem0ver3-Feb-18 23:03 
GeneralRe: Async method/task issue Pin
Gerry Schmitz4-Feb-18 7:05
mveGerry Schmitz4-Feb-18 7:05 
Questionin c# school management project Pin
Member 1289859014-Nov-17 19:51
Member 1289859014-Nov-17 19:51 
AnswerRe: in c# school management project Pin
OriginalGriff14-Nov-17 20:11
mveOriginalGriff14-Nov-17 20:11 
AnswerRe: in c# school management project Pin
Gerry Schmitz15-Nov-17 5:41
mveGerry Schmitz15-Nov-17 5:41 
AnswerRe: in c# school management project Pin
jschell15-Nov-17 7:03
jschell15-Nov-17 7:03 
QuestionDetermine Distance between HD Camera and Object Pin
Member 1041074814-Nov-17 4:09
Member 1041074814-Nov-17 4:09 
AnswerRe: Determine Distance between HD Camera and Object Pin
Richard MacCutchan14-Nov-17 4:51
mveRichard MacCutchan14-Nov-17 4:51 
AnswerRe: Determine Distance between HD Camera and Object Pin
Dave Kreskowiak14-Nov-17 5:24
mveDave Kreskowiak14-Nov-17 5:24 
AnswerRe: Determine Distance between HD Camera and Object Pin
Gerry Schmitz15-Nov-17 5:39
mveGerry Schmitz15-Nov-17 5:39 
Questionmy projects link button not work in iphone 6s but desktop work properly why? Pin
Member 1352056914-Nov-17 2:27
Member 1352056914-Nov-17 2:27 
AnswerRe: my projects link button not work in iphone 6s but desktop work properly why? Pin
Pete O'Hanlon14-Nov-17 3:37
mvePete O'Hanlon14-Nov-17 3:37 
AnswerRe: my projects link button not work in iphone 6s but desktop work properly why? Pin
Richard Deeming14-Nov-17 3:37
mveRichard Deeming14-Nov-17 3:37 
AnswerRe: my projects link button not work in iphone 6s but desktop work properly why? Pin
Richard MacCutchan14-Nov-17 4:50
mveRichard MacCutchan14-Nov-17 4:50 
AnswerRe: my projects link button not work in iphone 6s but desktop work properly why? Pin
Gerry Schmitz15-Nov-17 5:42
mveGerry Schmitz15-Nov-17 5:42 
Questionregex Pin
arkiboys14-Nov-17 1:50
arkiboys14-Nov-17 1:50 
AnswerRe: regex Pin
Richard Deeming14-Nov-17 2:08
mveRichard Deeming14-Nov-17 2:08 
Not with regular expressions! Laugh | :laugh:

Use DateTime.TryParseExact[^] to validate the string against your required format.

However, there's a small problem. Your "valid" string doesn't actually match the format you're validating against. Your format requires the letter "T" between the date and time, but neither of your strings have that.

C#
string input = "2017-09-19T08:04:31.123";

DateTime parsedDate;
bool isValid = DateTime.TryParseExact(input, 
    "yyyy-MM-ddThh:mm:ss.fff", 
    CultureInfo.InvariantCulture, 
    DateTimeStyles.AssumeUniversal, 
    out parsedDate);

/*
isValid: true
parsedDate: 2017-09-19 09:04:31.123 UTC
*/




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


AnswerRe: regex Pin
Kenneth Haugland14-Nov-17 2:09
mvaKenneth Haugland14-Nov-17 2:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.