in Education by
The following code, d has the current date. Depending on the current locale, it will return a date. Dim d As Date = Date.Today Note: I don't want to check whether the date is valid or not, but rather to know, whether it is in a 'dd-MM-yyyy', 'MM-dd-yyyy' or any other date format.. EDIT (29/06/2012 - Friday): The reason I am asking this question is because I am sick of trying to deal with dates in ASP.NET. I build a project on my local PC, where dates are "dd/MM/yyyy" and as soon as I upload it to the production server (usually in US, hence MM/dd/yyyy) the code breaks. So I usually deal with dates by converting them into yyyyMMdd format and also keep them in the database like that. That is the closest I get to an exception-free coding. In this case, it makes sense that there is no way to get the format from a returned date string. Therefore, I will carry on with my approach. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Date.Today is a DateTime, not a string. Thus, it does not have an inherent format.

Related questions

0 votes
    The following code, d has the current date. Depending on the current locale, it will return a date. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
0 votes
    ALL I am confused about the date field returned by microsoft academic rest api: JSON Example: { " ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    How to format a Microsoft JSON date?...
asked Jan 11, 2021 in Technology by JackTerrance
0 votes
    I am using Classic ASP and have the following VB script code From8to14 = date-14 To8to14 = date-8 This sets the two ... "& Day(From8to14) &"' " & _ "AND INTRAY.DateMatched...
asked Jul 6, 2022 in Education by JackTerrance
0 votes
    I have tried many solution online but I am unable to fix. First off all i check in bin and it ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a data which looks like EX:992215:SHOW:CMS016:000335:ESP:15:EUR:Euro:4:14:01/05/2009 :30 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: converting date format (5 answers) Closed 5 years ago. I have a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a data which looks like EX:992215:SHOW:CMS016:000335:ESP:15:EUR:Euro:4:14:01/05/2009 :30 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a data which looks like EX:992215:SHOW:CMS016:000335:ESP:15:EUR:Euro:4:14:01/05/2009 :30 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I been receiving date in the "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" format from JSON input, which gets ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    I am trying to convert a string into date format in Google Sheet. I've tried different formulas but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I want' to parse dates in this format, but ignore parts of the string. 'Wed, 27 Oct 1770 22:17: ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    How can I change the user input date format in Automation Anywhere without changing the system variable format? Example: ... 05/28/2018 Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    How can I change the user input date format in Automation Anywhere without changing the system variable format? Example: ... 05/28/2018 Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    What will be the syntax to find current date and time in format "YYYY-MM-DD"?...
asked Dec 18, 2020 in Technology by JackTerrance
...