Posted By

Scooter on 06/21/08


Tagged

DateTime


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

asifrizvigmailcom


AM/PM


 / Published in: ASP
 

URL: http://reusablecode.blogspot.com/2008/06/ampm.html

Extract the AM/PM portion from a time value.

  1. <%
  2. ' Copyright (c) 2008, www.thecanonman.com; some rights reserved.
  3. '
  4. ' This work is licensed under the Creative Commons Attribution License. To view
  5. ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  6. ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  7. ' 94305, USA.
  8.  
  9. ' Returns either AM or PM, given a Time value.
  10. function ampm(someTime)
  11. if hour(someTime) < 12 then
  12. ampm = "AM"
  13. else
  14. ampm = "PM"
  15. end if
  16. end function
  17. %>

Report this snippet  

You need to login to post a comment.