1

I have a field where users use a date picker to select a date. The value gets saved as "mm/dd/yyyy". I'm creating a query that needs to turn that into a timestamp. I tried using:

UNIX_TIMESTAMP(STR_TO_DATE(po.dueToProduction, '%y%m%d'))

but results were returned.

4

1 回答 1

4

的第二个参数(格式)STR_TO_DATE是您指定为“mm/dd/yyyy”的输入格式

UNIX_TIMESTAMP(STR_TO_DATE(po.dueToProduction, '%m/%d/%Y'))
于 2013-06-18T15:40:59.327 回答