• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue with Date objects

 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I have this simple method converting String dates to Dates to Strings of another format. For some reason the final result is one date for both Strings. I want to understand what's happening in the method that causes such behavior. Much appreciated.
Output:
start: 01/30/2012 -->January 30, 2012
end: 09/30/2012 -->January 30, 2012

Method:
 
Henry Wong
author
Marshal
Pie
Posts: 21220
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
liliya woland wrote:Hi all, I have this simple method converting String dates to Dates to Strings of another format. For some reason the final result is one date for both Strings. I want to understand what's happening in the method that causes such behavior. Much appreciated.
Output:
start: 01/30/2012 -->January 30, 2012
end: 09/30/2012 -->January 30, 2012

Method:



Note: m = minutes
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, now I'm seeing more of the issue. This convertion of 09/30/2012 -->January 30, 2012 is happening regardless of having or not having another date. Hm...
 
fred rosenberger
lowercase baba
Bartender
Posts: 12149
31
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to further emphasize Henry's point...

m is not the same thing as M.

Therefore, mm is not the same thing as MM.
 
liliya woland
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it, thanks a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic