What type of date string is this? `20210713T015433.354Z` [duplicate] - date

This question already has answers here:
What is this date format? 2011-08-12T20:17:46.384Z
(11 answers)
Closed 1 year ago.
I'm working with some data where I don't know how the time string was generated but an example of what the date string looks like is this 20210713T015433.354Z
I've looked at some examples of date strings (ex1 and ex2) but haven't had any luck decoding it.
I know that the first half of the string is YYYYMMDD, and then I think that T means times but then I don't know what 015433.354Z is.
My eventual goal is to make this into a Date objects in JS but I can't deduce the formatting. beyond the day it occured.

The date format provided is ISO 8601. Maybe you want to try the following to get a Date object:
new Date(Date.UTC(2021, 7, 13, 1, 54, 33, 354))
As pointed in this SO answer.

Related

Convert a date in string YYYY-MM-DD to MM/DD in JSTL [duplicate]

This question already has answers here:
Convert and format a Date in JSP
(6 answers)
Closed 5 years ago.
I have a string field that is shown as a date in YYYY-MM-DD format. I am trying to convert this field on my JSP to MM/DD date format. Here is the JSTL code I have now:
<fmt:parseDate var="taxFromDate" value="${a8spt214.fromDate}" pattern="MM-dd"/>
<fmt:parseDate var="taxToDate" value="${a8spt214.toDate}" pattern="MM-dd"/>
When I try running this I get a compile error saying the following
In <parseDate>, value attribute can not be parsed: "2017-06-30"] with root cause java.text.ParseException: Unparseable date: "2017-06-30"
is it possible to convert a string to a date filed in JSP without actually using the year in the format? Or is the pattern invalid?
Thanks
You can use this Code to show this type of date MM/DD/YY
<p>Formatted Date : <fmt:formatDate type = "both"
dateStyle = "short" timeStyle = "short" value = "${now}" /></p>
The Code above will Print this result:
Formatted Date : 23/09/10 14:27
I hope to help you solve problem.

Formatting a date retrieved from Wikidata

So let's say I have an Infobox template in Wikipedia that retrieves a company foundation date from Wikidata. It contains the following code:
|label7 = Year founded
|text7 = {{wikidata|p571|{{{founded|}}}}}
My problem is that what's retrieved is formatted as 31 January 2010 and it looks weird next to "Year founded' since it is not a year but the whole date. Of course I could rename the label from "Year founded" to "Date founded" and voila, problem solved, right? But I do want to just get the year from Wikidata, not the whole date.
What would be the code for this? I imagine something like {{wikidata|p571[year]|{{{founded|}}}}} or {{wikidata|p571[0]|{{{founded|}}}}} or {{wikidata|p571[YYYY]|{{{founded|}}}}}.
Thanks in advance!
This doesn't sound like a programming question, but it looks like you can request a specific date format as the third parameter to wikidata
https://en.wikipedia.org/wiki/Module:Wikidata#Testing_getValue.2C_getRawValue_and_getDateValue
{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}
I highly recomend you to filter the year from date using RegularExpression instead of trying to get only the year.

Format date and add month to it

I'm currently working with embarcadero c++, this is the first time I'm working with it so it's completely new to me.
What I'm trying to achieve is to get the current date, make sure the date has the "dd/MM/yyyy" format. When I'm sure this is the case I want to add a month to the current date.
So let's say the current date is 08/18/2016 this has to be changed to 18/08/2016 and then the end result should be 18/09/2016.
I've found that there is a method for this in embarcardero however I'm not sure how to use this.
currently I've only been able to get the current date like this.
TDateTime currentDate = Date();
I hope someone will be able to help me out here.
I figured it out.
After I've searched some more I found the way to use the IncMonth method on this page.
The example given my problem is as follows:
void __fastcall TForm1::edtMonthsExit(TObject *Sender)
{
TDateTime StartDate = edtStartDate->Text;
int Months = edtMonths->Text.ToInt();
TDateTime NextPeriod = IncMonth(StartDate, Months);
edtNextPeriod->Text = NextPeriod;
}
After looking at I changed my code accordingly to this
TDateTime CurrentDate = Date();
TDateTime EndDate = IncMonth(CurrentDate, 1);
A date object doesn't have a format like "dd/MM/yyyy". A date object is internally simply represented as a number (or possibly some other form of representation that really isn't your problem or responsibility).
So you don't have to check if it's in this format because no date objects will ever be in this format, they simply don't have a format.
You will have to do additions/subtractions on the Date object that the language or library gives you, THEN (optionally) you can format it to a human-readable string so it looks like 18/08/2016 or 18th of August 2016 or whatever other readable format that you choose.
It might be that the TRANSFER of a date between 2 systems is in a similar format, but then formatting the date like that is entirely up to you.
As for how to do that, the link you posted seems like a possible way (or alternatively http://docwiki.embarcadero.com/Libraries/Berlin/en/System.SysUtils.IncMonth), I'm afraid I can't give you an example as I'm not familiar with the tool/language involved, I'm just speaking generically about Date manipulations and they should ALWAYS be on the raw object.

Localized Date (LongDatePattern) Remove the year

I have this code to retrieve the Localized Date:
DateTime.Now.ToString(DateTimeFormatInfo.CurrentInfo.LongDatePattern);
The thing is that it returns the year also. I don't want the year.
So I thought I could remove the year pattern from the LongDatePattern. But there are commas in some countries and it would look bad if I removed the 2013 year.
Can someone help me to be able to do it?
Windows.Globalization.DateTimeFormatting.DateTimeFormatter will allow you to supply a template that specifies exactly which components you want included in the formatted result ("month day dayofweek") for example.

Trying to Convert String to Date [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
convert string to nsdate
The NSString has following value '2012-07-11T15:59:16'
I am unable to determine the correct format for NSDateFomatter.dateFormat property in order to covert it using dateFromString method. I tried 'yyyy-MM-ddTHH:mm:ss' and other similar formats but resultant date is nil.
A link with info about date formatting would be highly appreciated too.
Well you should be able to get it to work if you escape the the T:
[dateFormatter setDateFormat:#"yyyy-MM-dd'T'HH:mm:ss"];