1

Which data type can i use to store youtube video durations (ISO 8601, e.g. PT20M38S) given by YouTube Data API v3?

I googled about storing ISO 8601 data and tried DATETIME but it converts it into 0000-00-00 00:00:00.

party34
  • 99
  • 3
  • 14
  • 1
    Duration doesn't make sense as a single timestamp, since a duration essentially translates to a start and end date. But, date doesn't matter; 5 minutes today is the same as 5 minutes tomorrow. Maybe store as an `integer` of seconds? Or something more precise if you need that. – Tim Lewis Jul 25 '18 at 20:12

1 Answers1

2

Ideally, you should convert the timestamp given by youtube to seconds (As the format it's in is not very helpful if you're trying to do database operations with), and according to generally accepted answer store it that way:

MySQL storing duration time - datatype?

Blue
  • 22,608
  • 7
  • 62
  • 92