Project

to_xl

0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem to convert Time, Date, and DateTime instances to Excel date integers. And to convert Excel date integers/decimals to Ruby dates.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

to_xl

Small gem to convert ruby Time, Date, and DateTime instances to Excel date integers. This is helpful when using some Excel parsers to compare the dates in the spreadsheet to dates you may be using elsewhere in the script.

Usage

Simple! Require the gem require 'to_xl', initialize a Time, Date or DateTime value. Call .to_xl on it.

Example

irb(main):002:0> require 'to_xl'
=> true
irb(main):003:0> Time.now.to_xl
=> 42389
irb(main):004:0> Date.today.to_xl
=> 42389
irb(main):005:0> DateTime.now.to_xl
=> 42389
That result in Excel:

The above integer in Excel (and formated)

from_xl

You can also convert a date integer or float taken from Excel into a Ruby Time object. Simply call from_excel