FLASH-X
Doxygen Generated Documentation From Interface Source Code
current_date_time.F90
Go to the documentation of this file.
1!! NOTICE
2!! Copyright 2022 UChicago Argonne, LLC and contributors
3!!
4!! Licensed under the Apache License, Version 2.0 (the "License");
5!! you may not use this file except in compliance with the License.
6!!
7!! Unless required by applicable law or agreed to in writing, software
8!! distributed under the License is distributed on an "AS IS" BASIS,
9!! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10!! See the License for the specific language governing permissions and
11!! limitations under the License.
12!!
28
29subroutine current_date_time(date_string)
30
31 implicit none
32
33 character(len=*),intent(out) :: date_string
34
35 character (len=8) :: current_date
36 character (len=10) :: current_time
37 character (len=5) :: time_zone
38
39 integer :: date_values(8)
40
41
42 character (len=2) :: month_string, day_string, hour_string, &
43 minute_string, seconds_string
44
45 character (len=4) :: year_string
46
47 call date_and_time(current_date, current_time, time_zone, date_values)
48
49 write (year_string, '(i4.4)') date_values(1)
50 write (month_string, '(i2.2)') date_values(2)
51 write (day_string, '(i2.2)') date_values(3)
52 write (hour_string, '(i2.2)') date_values(5)
53 write (minute_string, '(i2.2)') date_values(6)
54 write (seconds_string, '(i2.2)') date_values(7)
55
56 date_string = month_string // '-' // day_string // '-' // &
57 year_string // ' ' // hour_string // ':' // minute_string // &
58 ':' // seconds_string // '.' // current_time(8:10)
59
60
61 return
62end subroutine current_date_time
subroutine current_date_time(date_string)