A two digit year is a representation of the four number year shown only with the last two digits - for example, 12 being displayed rather than 2012.
Questions tagged [2-digit-year]
39 questions
1
vote
2 answers
Error converting date with two digits for the Year field
// input format: dd/MM/yy
SimpleDateFormat parser = new SimpleDateFormat("dd/MM/yy");
// output format: yyyy-MM-dd
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(formatter.format(parser.parse("12/1/20"))); //…

Sushil Dubey
- 33
- 7
1
vote
4 answers
how to use str_to_date (MySQL) to parse two-digit year correctly
I'm using MySQL and I need to import a table that has DOBs from the last century. So the person was born in 1965, but the two-digit year format is used in the string. Any idea how to get this right?
mysql> select str_to_date('09-JAN-65',…

mjkrause
- 406
- 1
- 7
- 14
1
vote
1 answer
Localize string from `MonthDay` or `YearMonth` classes in java.time?
The java.time classes built into Java 8 and later offer the MonthDay and YearMonth classes. Their toString and parse methods use standard ISO 8601 formats (--MM-DD & YYYY-MM), which is wise.
For presentation to humans, the standard formats may not…

Basil Bourque
- 303,325
- 100
- 852
- 1,154
1
vote
3 answers
Converting dates from YY to YYYY --- how do compilers/interpreters know to use the correct century?
I was just doing a bunch of importing of an old database, and as I was watching the results roll by, I wondered, how/why does it know to convert 12/31/13 to 12/31/2013, but 12/31/99 to 12/31/1999? ("it" in this case is Python's strftime(%Y/%m/%d)…

CptSupermrkt
- 6,844
- 12
- 56
- 87
0
votes
0 answers
Create new sheet with google Apps Script and set name as 21-08
I am a newbie to google script. I need help to create a new sheet based on last sheet for e.g., last sheet name 21.07 (year and month) and then increment new sheet name to next month i.e 21.08
Thanks

Tee Yar
- 1
0
votes
2 answers
Why Year part of date in update query statement updating wrong year when year is >= 2050
I am trying to insert/update DATE_OF_RETIREMENT column, but when the year is >=2050, it takes as 1950.
Example:
UPDATE EMPLOYEE
SET STATUS = '4',
ISACTIVE = 1,
DATE_OF_RETIREMENT = '30-APR-49'
WHERE ID = 2001;
Here…

Jimmy
- 995
- 9
- 18
0
votes
2 answers
Date conversion from "JAN02/19 to 2019-01-02
How do I convert the values of a varchar(25) column from dates in the format "JAN02/19" to "2019-01-02"(YYYY-MM-DD)?

swathi
- 91
- 1
- 9
0
votes
2 answers
how to get year and week from date
I need help in making code to extract the year and week number from the date. I needed to segregate orders by week, not on individual days.
I need to get format yy, WW.
In excel function I can write something like…

marwineper
- 21
- 1
0
votes
1 answer
is there any way to convert the date in java prior to 1970?
I wanted to convert date in yymmdd format to YYYYMMDD, but when using the simpledateformat class i am getting the years after 1970, but the requirement is of the year which is prior to 1970.

Shubham
- 43
- 5
0
votes
0 answers
Assigning a year value to sbyte
I am using a function which is present in a library which I cannot modify. That function is used to set the Date by the user. Its parameters are
SetDate(sbyte day, sbyte month, sbyte year)
When I assign 2019. I want to assign 2019 to sbyte year.…

chaudhry
- 21
- 8
0
votes
1 answer
Character 2 digit year conversion to year only
Using R
Got large clinical health data set to play with, but dates are weird
Most problematic is 2digityear/halfyear, as in 98/2, meaning at some point in 1998 after July 1
I have split the column up into 2 character columns, e.g. 98 and 2 but now…

LeanneB
- 69
- 8
0
votes
0 answers
How to display a 2-digit year + ISO week in PDF using JavaScript
I would like to have a form field in a PDF that autofills with the date formatted as "YYWK", where YY is the 2-digit year and WK is the ISO week. I have seen code here on how to display the ISO week (https://weeknumber.net/how-to/javascript). What I…

Ashley L.
- 1
- 1
0
votes
3 answers
How to show the years b/w to specific dates
I am working on a php. In my project when a student register, he chooses starting and ending date of his course e.g (2012/06/05) - (2015/06/25). Now he submit his fees after every six months. now what I want to do is that when student fill the form…

rahul s negi
- 139
- 14
0
votes
1 answer
Convert 4 digit year to 2 digit year
fourdigityear<-c("2003/7/15","2009/6/12")
How should I convert 4-digit year to 2-digit year so I end up having something like "7/15/03","12/6/09".

Louis Lee
- 51
- 1
- 4
0
votes
3 answers
gsub for dealing with dates in r in data
I am dealing with very large data set of university students where dates are in the form
%d/%m/%y
I need to work out ages.
My data looks something like this as it was pulled from a database:
data <- data.table(DOB=c("12/12/01", "8/05/80",…

monkeyshines
- 1,058
- 2
- 8
- 25