package com.aperture_software.glados_wiki.tests; import com.aperture_software.glados_wiki.entities.User; import com.aperture_software.glados_wiki.junit.MyTestcase; import com.aperture_software.glados_wiki.services.UserService; import com.google.common.base.Optional; import junit.framework.Assert; import org.apache.commons.lang3.ObjectUtils; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.TimeZone; /** * Created by jhyun on 13. 12. 25. */ public class UserUtcTests extends MyTestcase { @Autowired private UserService userService; @Test public void t_01() { List<User> l = userService.list(Optional.<String>absent(), Optional.<String>absent(), 0, 1); Assert.assertFalse(l.isEmpty()); User u = l.get(0); Assert.assertNotNull(u); Date dt = u.getCtime(); Assert.assertNotNull(dt); LOG.debug("DATE (GMT) = " + ObjectUtils.toString(dt)); // SimpleDateFormat f = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss"); f.setTimeZone(TimeZone.getTimeZone("UTC")); LOG.debug("DATE (UTC) = " + f.format(dt)); } }