> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/d/date_manipulation.md).

# Date manipulation

```ruby
var dt = frequire('DateTime::Format::Strptime')

var input =  'March 7 2009 7:30pm EST'
input.sub!('EST', 'America/New_York')

say dt.strptime('%b %d %Y %I:%M%p %O', input)   \
      .add(hours => 12)                         \
      .set_time_zone('America/Edmonton')        \
      .format_cldr('MMMM d yyyy h:mma zzz')
```

#### Output:

```
March 8 2009 6:30AM MDT
```
