login about faq

I am having trouble figuring out the best way to convert an email date to a formatted string. I know I can use email.emailDateStr() to get Sat, 31 Oct 2015 01:03:26 GMT, but that is a long cumbersome representation.

What I would like is to have 10/31/15 01:03 as the end result. I thought I could use SimpleDateFormat like this...

SimpleDateFormat sdf=new SimpleDateFormat(MM/dd/yy HH:mm");
String tmpstr=sdf.format(email.GetDt());

but that doesn't seem to work. I think it might be because GetDt() is returning a CkDateString and SimpleDateFormat is expecting milliseconds from what I have read.

I see that CkDateTime has a variety of GetAs methods but none seem to provide the right data for conversion.

Am I missing something?

Thanks Pete

asked Nov 13 '15 at 20:31

pbrama's gravatar image

pbrama
9334

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×45
×4
×2

Asked: Nov 13 '15 at 20:31

Seen: 393 times

Last updated: Nov 13 '15 at 20:31

powered by OSQA