Comments (2)
It could be useful to include adapters to other datetimes, perhaps under a separate repo, perhaps toml-f/toml-datetime-adapters or similar. I think you should keep the main toml-f library clean and not pull in other datetime implementations. If and when there is ever an ubiquitous datetime implementation in Fortran, then you could just use that in the main toml-f library.
But showing how to do this in the toml-f docs would be a good first step IMO. For datetime-fortran, something like this (I didn't test the code, only typed it here)?
module tomlf_datetime_adapters
use tomlf_datetime, only: toml_datetime
use datetime_module, only: datetime
implicit none
contains
elemental type(datetime) function toml_datetime_to_datetime_fortran(d) result(res)
type(toml_datetime), intent(in) :: d
res = datetime( &
year=d % date % year, &
month=d % date % month, &
day=d % date % day, &
hour=d % time % hour, &
minute=d % time % minute, &
second=d % time % second, &
millisecond=d % time % msec, &
tz=timezone_offset_from_timezone_name(d % time % zone) ! not implemented
)
end function toml_datetime_to_datetime_fortran
end module tomlf_datetime_adapters
from toml-f.
I only now saw #103, looks good.
from toml-f.
Related Issues (20)
- Reliable display of colored output in docs
- Compatibility with stdlib
- Return allocation on deletion from table
- child is always associated in get_value even if requested section is missing HOT 2
- Support non-English scripts for bare keys
- Changes implemented in toml-f 0.3.1 compare with 0.2.4 results in FPM tests fail HOT 1
- how to pass default value and check if a key exist in toml file HOT 4
- Internal compiler error detected when building the project HOT 5
- No error stat when a table is missing HOT 2
- Release TOML Fortran version 0.4.0
- Continuously test fpm with latest TOML Fortran HOT 2
- Support null/none/nil value in parser
- Alternatives to ieee_value for creating exceptional values HOT 12
- Compiling with Cray Fortran 14 HOT 9
- cmake CMP0110 warning
- Infinite loop with """\"""
- compilation error with intel/2020 HOT 3
- Support \x escape code in strings
- Support optional seconds in datetime values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toml-f.