julian day 15008.0239 to datetime in python -


i want date , time format in python julian day. have file hdf t1.15008.0239.mod07.hdf , have tried convert julian day '15008' dateyear, this:

def julday_to_masehi(julday): file_date= julday file_date = datetime.strptime(file_date, '%y%j') file_date = file_date.strftime('%y-%m-%d') return file_date  julday = '15232' datetimee = julday_to_masehi(julday) print(datetimee) 

and result 2015-08-20 need time. if initial julday = '150080239' , change code file_date = file_date.strftime('%y-%m-%d %h:%m:%s'),then got error. how can convert julian day '150080239' python datetime in format '%y-%m-%d %h:%m:%s'?

date, time = jul_date_time.split('.') hour = int(time[:2]) minute = int(time[2:]) 

you showed can handle date; lets construct python time -- , datetime -- pieces of input string.

is need?


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -