/** Return "now" as readable string (date in yyyy/MM/dd format) */ public static String nowAsString() { return nowAsString(dateTimeFmt_display) ; }
/** Now, as xsd:dateTime Node */ public static Node nowAsDateTime() { String lex = DateTimeUtils.nowAsXSDDateTimeString() ; return NodeFactory.createLiteral(lex, XSDDatatype.XSDdateTime) ; }
public static String todayAsXSDDateString() { return calendarToXSDDateString(new GregorianCalendar()) ; }
version = null ; if ( buildDate != null && buildDate.equals("${build.time.xsd}") ) buildDate = DateTimeUtils.nowAsXSDDateTimeString() ; throw new FusekiException("Failed to start server: " + ex.getMessage(), ex) ; String now = DateTimeUtils.nowAsString() ; serverLog.info(format("Started %s on port %d", now, serverConnector.getPort())) ;
public static String nowAsXSDDateTimeString() { return calendarToXSDDateTimeString(new GregorianCalendar()) ; }
/** Calendar to xsd:time Node */ public static Node timeToNode(Calendar c) { String lex = DateTimeUtils.calendarToXSDTimeString(c) ; return NodeFactory.createLiteral(lex, XSDDatatype.XSDtime) ; }
/** Today, as xsd:date Node */ public static Node todayAsDate() { String lex = DateTimeUtils.todayAsXSDDateString() ; return NodeFactory.createLiteral(lex, XSDDatatype.XSDdate) ; }
version = null ; if ( buildDate != null && buildDate.equals("${build.time.xsd}") ) buildDate = DateTimeUtils.nowAsXSDDateTimeString() ; throw new FusekiException("Failed to start server: " + ex.getMessage(), ex) ; String now = DateTimeUtils.nowAsString() ; serverLog.info(format("Started %s on port %d", now, serverConnector.getPort())) ;
public static String nowAsXSDDateTimeString() { return calendarToXSDDateTimeString(new GregorianCalendar()) ; }
@Test public void testCalendarToXSDTimeString_1() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 0, "GMT+01:00"); assertEquals("14:32:01+01:00", DateTimeUtils.calendarToXSDTimeString(cal)); // Different timezone - moves the cal point-in-time. cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("06:32:01-07:00", DateTimeUtils.calendarToXSDTimeString(cal)); }
private Resource createResult(Resource outcome) { // String nowStr = Utils.nowAsXSDDateTimeString() ; // // Literal now = // ResourceFactory.createTypedLiteral(nowStr, XSDDatatype.XSDdateTime) ; String todayStr = DateTimeUtils.todayAsXSDDateString() ; Literal now = ResourceFactory.createTypedLiteral(todayStr, XSDDatatype.XSDdate) ; return earl.createResource(EARL.TestResult) .addProperty(EARL.outcome, outcome) .addProperty(DC.date, now) ; }
/** Return "now" as readable string (date in yyyy/MM/dd format) */ public static String nowAsString() { return nowAsString(dateTimeFmt_display) ; }
protected void doCommon(HttpServletRequest request, HttpServletResponse response) { try { ServletOps.setNoCache(response) ; response.setContentType(contentTypeTextPlain); response.setCharacterEncoding(charsetUTF8) ; response.setStatus(HttpSC.OK_200); ServletOutputStream out = response.getOutputStream() ; out.println(DateTimeUtils.nowAsXSDDateTimeString()); } catch (IOException ex) { Fuseki.serverLog.warn("ping :: IOException :: "+ex.getMessage()); } } }
public static NodeValue makeNodeDateTime(Calendar date) { String lex = DateTimeUtils.calendarToXSDDateTimeString(date) ; NodeValue nv = makeNode(lex, XSDdateTime) ; return nv ; }
public static String todayAsXSDDateString() { return calendarToXSDDateString(new GregorianCalendar()) ; }
@Test public void testCalendarToXSDTimeString_2() { Calendar cal = createCalendar(1984, Calendar.MARCH, 22, 14, 32, 1, 500, "GMT+01:00"); assertEquals("14:32:01.500+01:00", DateTimeUtils.calendarToXSDTimeString(cal)); // Different timezone - moves the cal point-in-time. cal.setTimeZone(TimeZone.getTimeZone("MST")); assertEquals("06:32:01.500-07:00", DateTimeUtils.calendarToXSDTimeString(cal)); }
public void setLastQueryExecAt() { timeSeen = DateTimeUtils.nowAsString() ; }
protected void doCommon(HttpServletRequest request, HttpServletResponse response) { try { ServletOps.setNoCache(response) ; response.setContentType(contentTypeTextPlain); response.setCharacterEncoding(charsetUTF8) ; response.setStatus(HttpSC.OK_200); ServletOutputStream out = response.getOutputStream() ; out.println(DateTimeUtils.nowAsXSDDateTimeString()); } catch (IOException ex) { Fuseki.serverLog.warn("ping :: IOException :: "+ex.getMessage()); } } }
public static NodeValue makeDateTime(Calendar cal) { String lex = DateTimeUtils.calendarToXSDDateTimeString(cal) ; return NodeValue.makeNode(lex, XSDdateTime) ; }
public static NodeValue makeDate(Calendar cal) { String lex = DateTimeUtils.calendarToXSDDateString(cal) ; return NodeValue.makeNode(lex, XSDdate) ; }