Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libmtime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
icon-libraries
libmtime
Commits
6accf999
Commit
6accf999
authored
7 years ago
by
Michael Weimer
Browse files
Options
Downloads
Patches
Plain Diff
[bug-create-timedelta] added example with newTimeDelta with integers
parent
18c7bc90
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/example.f90
+23
-0
23 additions, 0 deletions
examples/example.f90
with
23 additions
and
0 deletions
examples/example.f90
+
23
−
0
View file @
6accf999
...
...
@@ -23,12 +23,16 @@ program example
type
(
datetime
),
pointer
::
stop_date
type
(
timedelta
),
pointer
::
time_step
type
(
timedelta
),
pointer
::
td_one_hour
type
(
datetime
),
pointer
::
current_date
type
(
datetime
),
pointer
::
current_date_test
type
(
datetime
),
pointer
::
tmp_date_test_1
type
(
datetime
),
pointer
::
dt
type
(
datetime
),
pointer
::
dt_mw
! setup of calendar
...
...
@@ -108,6 +112,25 @@ program example
call
event_tests
call
icon_tests
td_one_hour
=>
newTimeDelta
(
'-'
,
0
,
0
,
0
,
1
,
0
,
0
,
0
)
dt_mw
=>
newDateTime
(
"2015-03-01T00:00:00Z"
)
call
timedeltaToString
(
td_one_hour
,
time_step_string
)
print
*
,
'time delta -1 hour : '
,
trim
(
time_step_string
)
call
datetimeToString
(
dt_mw
,
current_date_string
)
print
*
,
'datetime 2015-03-01 : '
,
trim
(
current_date_string
)
dt_mw
=
dt_mw
+
td_one_hour
call
datetimeToString
(
dt_mw
,
current_date_string
)
print
*
,
'datetime 2015-03-01 minus 1 hour : '
,
trim
(
current_date_string
)
call
deallocateTimeDelta
(
td_one_hour
)
! reset calendar
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment