Advertisement
Guest User

Untitled

a guest
Mar 31st, 2014
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select starttime from dtab limit 10;
  2. +---------------+
  3. | starttime |
  4. +---------------+
  5. | 1364684890000 |
  6. | 1364685077000 |
  7. | 1364685298000 |
  8. | 1364685747000 |
  9. | 1364685837000 |
  10. | 1364685947000 |
  11. | 1364686068000 |
  12. | 1364686108000 |
  13. | 1364686109000 |
  14. | 1364686204000 |
  15. +---------------+
  16. 10 rows in set (0.00 sec)
  17.  
  18.  
  19. select from_unixtime(starttime/1000), from_unixtime(starttime/1000) + interval 1 year, unix_timestamp(from_unixtime(starttime/1000) + interval 1 year) * 1000 as ts from dtab limit 10;
  20. +-------------------------------+-------------------------------------------------+--------------------+
  21. | from_unixtime(starttime/1000) | from_unixtime(starttime/1000) + interval 1 year | ts |
  22. +-------------------------------+-------------------------------------------------+--------------------+
  23. | 2013-03-31 00:08:10.0000 | 2014-03-31 00:08:10.0000 | 1396217290000.0000 |
  24. | 2013-03-31 00:11:17.0000 | 2014-03-31 00:11:17.0000 | 1396217477000.0000 |
  25. | 2013-03-31 00:14:58.0000 | 2014-03-31 00:14:58.0000 | 1396217698000.0000 |
  26. | 2013-03-31 00:22:27.0000 | 2014-03-31 00:22:27.0000 | 1396218147000.0000 |
  27. | 2013-03-31 00:23:57.0000 | 2014-03-31 00:23:57.0000 | 1396218237000.0000 |
  28. | 2013-03-31 00:25:47.0000 | 2014-03-31 00:25:47.0000 | 1396218347000.0000 |
  29. | 2013-03-31 00:27:48.0000 | 2014-03-31 00:27:48.0000 | 1396218468000.0000 |
  30. | 2013-03-31 00:28:28.0000 | 2014-03-31 00:28:28.0000 | 1396218508000.0000 |
  31. | 2013-03-31 00:28:29.0000 | 2014-03-31 00:28:29.0000 | 1396218509000.0000 |
  32. | 2013-03-31 00:30:04.0000 | 2014-03-31 00:30:04.0000 | 1396218604000.0000 |
  33. +-------------------------------+-------------------------------------------------+--------------------+
  34. 10 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement