Skip to main content
Solved

Convert julian calendar to YYYYMMDD for images


hoa_le
Contributor
Forum|alt.badge.img+5

Hi,

I have a image folder (.TIF) which the structure MODIS_2017001.tif, MODIS_2017009.tif, MODIS_2017017.tif,...

My target want to convert julian calender to YYYYMMDD.

For example : MODIS_2017001 -> MODIS_20170101; MODIS_2017009 -> MODIS_20170109; MODIS_2017017 -> MODIS_20170117

Could you tell me how to the way to make it?

Thank you

Best answer by takashi

Hi @hoa_le, do you perhaps mean "day of year" (001-365 or 366 in a leap year)? If so, you can convert the date format from "YYYYDDD" to "YYYYMMDD" with the DateTimeConvertor.

  • Input Format: %Y%j
  • Output Format: %Y%m%d
View original
Did this help you find an answer to your question?

7 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 14, 2018
How did you determine that the source dates (2017001, 2017009, 2017017) belong January?

 

 


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 14, 2018
takashi wrote:
How did you determine that the source dates (2017001, 2017009, 2017017) belong January?

 

 

Yes. I use julian calender 2017 to compare. I have a excel file colums : 001 -> 0101, 009 -> 0109...

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • August 14, 2018

Hi @hoa_le, do you perhaps mean "day of year" (001-365 or 366 in a leap year)? If so, you can convert the date format from "YYYYDDD" to "YYYYMMDD" with the DateTimeConvertor.

  • Input Format: %Y%j
  • Output Format: %Y%m%d

hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 14, 2018
takashi wrote:

Hi @hoa_le, do you perhaps mean "day of year" (001-365 or 366 in a leap year)? If so, you can convert the date format from "YYYYDDD" to "YYYYMMDD" with the DateTimeConvertor.

  • Input Format: %Y%j
  • Output Format: %Y%m%d
Yes. But if my file structure: MODIS_2017001_h28v07.

 

When I use DateTimeConvertor, I have to use SubstringExtractor to extract date (2017001) and extract string and create new attribute as figure but It writes to 3 files.

 

It seems SubstringExtractor is not corectly.

 


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 14, 2018
takashi wrote:

Hi @hoa_le, do you perhaps mean "day of year" (001-365 or 366 in a leap year)? If so, you can convert the date format from "YYYYDDD" to "YYYYMMDD" with the DateTimeConvertor.

  • Input Format: %Y%j
  • Output Format: %Y%m%d
If the input string always consists of three parts separated by underscore, you can split it and save the parts into a list (e.g. "_list{}") with the AttributeSplitter, convert the date format of the middle part ("_list{1}") with the DateTimeConverter, then concatenate the three elements of the list with the ListConcatenator.

 


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 14, 2018
takashi wrote:

Hi @hoa_le, do you perhaps mean "day of year" (001-365 or 366 in a leap year)? If so, you can convert the date format from "YYYYDDD" to "YYYYMMDD" with the DateTimeConvertor.

  • Input Format: %Y%j
  • Output Format: %Y%m%d
This screenshot illustrates my intention.

 


hoa_le
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 14, 2018
takashi wrote:
This screenshot illustrates my intention.

 

Thank you so much @takashi

 

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings