In Ruby on Rails, how do I format a date with the “th” suffix, as in, “Sun Oct 5th”?

I want to display dates in the format: short day of week, short month, day of month without leading zero but including “th”, “st”, “nd”, or “rd” suffix. For example, the day this question was asked would display “Thu Oct 2nd”. I’m using Ruby 1.8.7, and Time.strftime just doesn’t seem to do this. I’d prefer … Read more

Java SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss’Z'”) gives timezone as IST

I have SimpleDateFormat constructor as SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss’Z'”) and I am parsing string “2013-09-29T18:46:19Z”. I have read that here Z represents the GMT/UTC timezone. but when I print this date on console , It prints IST timezne for the returned date. Now my question is whether my output is right or wrong? 8 Answers 8

How to set post expiration date and time and move the page to archive after expiration [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. My requirement is to move the certain posts … Read more

How to parse a date? [duplicate]

This question already has answers here: Java string to date conversion (17 answers) Closed 5 years ago. I am trying to parse this date with SimpleDateFormat and it is not working: import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Formaterclass { public static void main(String[] args) throws ParseException{ String strDate = “Thu Jun 18 20:56:02 … Read more

Custom Post Type Events Archive Grouped By Month

I’m currently trying to get my events listing code to print out headers by Month. So basically this: October event event September event event etc… Right now it just keeps echoing January. I think it might have something to do with the $currentMonth or the strtotime() but I’m not sure what. Any suggestions? I’ve been … Read more