Skip to content

Instantly share code, notes, and snippets.

@chankeypathak
Created August 18, 2015 09:20
Show Gist options
  • Save chankeypathak/b16ba312a82a060c9eef to your computer and use it in GitHub Desktop.
Save chankeypathak/b16ba312a82a060c9eef to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use Time::Piece;
my $in_format = '%Y-%m-%d %H:%M:%S';
my $out_format = '%Y-%m-%dT%H:%M:%SZ';
my $in_date = '2015-08-18 08:51:00';
my $date = Time::Piece->strptime($in_date, $in_format);
say $date->strftime($out_format);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment