Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date.createFromMysql = function(mysql_string)
- {
- if(typeof mysql_string === 'string')
- {
- var t = mysql_string.split(/[- :]/);
- //when t[3], t[4] and t[5] are missing they defaults to zero
- return new Date(t[0], t[1] - 1, t[2], t[3] || 0, t[4] || 0, t[5] || 0);
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment