MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / dateIso8601

Method dateIso8601

src/main/java/ui/Time.java:168–182  ·  view source on GitHub ↗
(String sdate)

Source from the content-addressed store, hash-verified

166 { 0, 5, 8, 11, 14, 17 } ;//XEP-0203
167
168 public static long dateIso8601(String sdate){
169 int[] ofs=ofsFieldsA;
170 if (sdate.endsWith("Z")) ofs=ofsFieldsB;
171 try {
172 int l=4; // yearlen
173 for (int i=0; i<calFields.length; i++){
174 int begIndex=ofs[i];
175 int field=Integer.parseInt(sdate.substring(begIndex, begIndex+l));
176 if (i==1) field+=Calendar.JANUARY-1;
177 l=2;
178 c.set(calFields[i], field);
179 }
180 } catch (Exception e) { }
181 return c.getTime().getTime();
182 }
183
184 public static long dateStringToLong(String sdate){
185 int field=0;

Callers 1

getMessageTimeMethod · 0.95

Calls 2

getTimeMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected