openmolecules.org

 
Home » DataWarrior » Functionality » Calculate number of dates between 2 dates
Re: Calculate number of dates between 2 dates [message #1854 is a reply to message #1853] Tue, 21 February 2023 10:28 Go to previous messageGo to previous message
thomas is currently offline  thomas
Messages: 661
Registered: June 2014
Senior Member
If you have a table with two date columns like the following

Date1 Date2
10-Jan-2020 10-Jan-2021
15-Jan-2020 18-Jan-2021
22-Jan-2020 10-Feb-2020

and use "Data->Add Calculated Values..." with formula "Date2-Date1", then you get a new column as:

Date1 Date2 Delta
10-Jan-2020 10-Jan-2021 366
15-Jan-2020 18-Jan-2021 369
22-Jan-2020 10-Feb-2020 19

DataWarrior has no defined date format. It uses a plausibility check whether a column is likely to contain date values. If a column contains three values in a consistent format, and if two values are in the range 1-31, 1-12 (or English three letter month abbreviations), and the third looks like a year, then a column is interpreted as date values.

Thomas
 
Read Message
Read Message
Read Message
Previous Topic: List Membership Filter
Next Topic: histograms 2D view
Goto Forum:
  


Current Time: Fri May 17 05:01:32 CEST 2024

Total time taken to generate the page: 0.04861 seconds