Copyright | (c) IOcrafts 2024-present |
---|---|
License | BSD |
Maintainer | Maurizio Dusi |
Stability | stable |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Util
Description
This module provides utility functions for file, date and time manipulation.
Documentation
createFile :: FilePath -> IO () Source #
Create a file if it does not exist.
Example usage:
>>>
createFile "test.txt"
toDate :: String -> UTCTime Source #
Convert a string to seconds since Epoch. The input string should be in the format %F %R %Z (YYYY-MM-DD HH-mm and abbreviated time zone name). If the parsing fails, it defaults to the beginning of Epoch (i.e., zero).
Example usage:
>>>
toDate "2022-01-01 12:00 UTC"
2022-01-01 12:00:00 UTC