Module utils

Module utils 

Source

Functions§

create_dir
Create a directory & all parent directories if they don’t exist & return the name. Panic if an error occurs while creating the dir
create_or_open_file
Open a file for appending or create it if it doesn’t exist Panic on error, return the file handle
datetime_from_str
datetime_to_readable_str
format_datetime
get_date_from_arg
Returns a DateTime given a date string If end == true, the date returned has a time of 23:59:59 to support the range being inclusive so that 12-01..12-10 would include all sessions started on 12-10
get_file_contents
get_home_dir
Return the value of $HOME or panic if it doesn’t exist
get_length_hours
Returns the length in hours between the start & end time
get_metadata_created
Get the created time or panic
get_start_date
local_to_fixed_offset
parse_date_range
parses string in (..()?)? format where date -> ‘today’ | yyyy-mm-dd | mm-dd returns the range (<earliest_tempus_date>, ), inclusive .. returns the range (, ), inclusive .. returns the range (, ), inclusive ‘today’ can be used in place of a date instead of typing today’s date a date without the year will search for this year
system_time_to_datetime
Convert a SystemTime to chrono::DateTime