Skip to content

Instantly share code, notes, and snippets.

@kpumuk
Created February 11, 2011 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kpumuk/821985 to your computer and use it in GitHub Desktop.
Save kpumuk/821985 to your computer and use it in GitHub Desktop.
Marshal.dump and different date/time classes in Ruby
Marshal.dump Date.today
# "\004\bu:\tDate=\004\b[\bo:\rRational\a:\021@denominatori\a:\017@numeratori\003g?Jii\003\031\025#"
Marshal.dump Time.now
# "\004\bIu:\tTime\re?200\247?U?:\037@marshal_with_utc_coercionF"
Marshal.dump DateTime.now
# "\004\bu:\rDateTimeT\004\b[\bo:\rRational\a:\021@denominatorl+\b\000 \235\264\006\000:\017@numeratorl+\t\227՗A\272@?o;\a;\006i\035;\ai?i\025#"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment