---
title: "CRMOD dateV2ToV1"
author: "bd2007"
date: "2011-10-09T11:17:08Z"
tags: []
categories: ["编程语言"]
slug: "crmod-datev2tov1"
draft: false
lastmod: "2011-10-09T11:17:08Z"
id: 1187525
url: "https://bd2007.iteye.com/blog/1187525"
---

```java
private string datev2tov1(string scheduleddate) {	// date format for v2 is: yyyy-mm-ddthh:mm:ssz	scheduleddate = scheduleddate.replaceall("-", ":").replaceall("t", ":").replaceall("t", ":").replaceall("z", ":").replaceall("z", ":");	scheduleddate = scheduleddate.substring(0, scheduleddate.length() - 1);	string[] v2 = scheduleddate.split(":");	// date format for v1 is: mm/dd/yyy hh:mm:ss	return v2[1] + "/" + v2[2] + "/" + v2[0] + " " + v2[3] + ":" + v2[4] + ":" + v2[5];}
```