What is the easiest way to use these variables:
year: "2011"
month: "8"
date: "28"
hours: "1"
minutes: "4"
to create a DateTime (i.e. Sun, 28 Aug 2011 01:04:00 +1000). The time zone does not matter.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
DateTime::civilChange that to
to_i(10)everywhere if you’re worried about something like"08"being interpreted as an octal number.