Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A good utility to calculate date/time differences #213

Open
Gavin-Holt opened this issue Jan 20, 2023 · 1 comment
Open

A good utility to calculate date/time differences #213

Gavin-Holt opened this issue Jan 20, 2023 · 1 comment

Comments

@Gavin-Holt
Copy link

Gavin-Holt commented Jan 20, 2023

Hi,

I was very excited to discover CSVtk and delighted that I could create data pipelines.

However, my use-case requires me to calculate date/time intervals to see how long patients wait for surgery (hours for emergencies, days for elective surgery). I would like to append new fields with the calculations.

Does anyone know of a good utility that allows me to calculate date/time differences (on a Windows machine) in a pipeline?

Good equates to:

  • Free, with compiled executables for Windows.
  • Read and write to stdin/stdout.
  • Works at the command line and in a batch file, without having to "escape" multiple characters, as this is the nightmare of trying to use awk at the command line in windows.

I guess I might need several functions:

  • now(output-format)
  • date2str(data,output-format)
  • str2date(data,input-format)
  • datedif(date1,date2,output-format)

For my current project, I have had to manually edit the source data using Excel, breaking automation - I feel dirty!

Kind Regards Gavin Holt

@derekmahar
Copy link

If you could run your data pipeline in Windows Subsystem for Linux or Cygwin, dateutils should meet your requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants