source: ccr/trunk/nhin-vista/projects/NHINC/Current/Product/Production/Gateway/PatientCorrelationFacadeDteEjb/src/java/gov/hhs/fha/nhinc/common/patientcorrelationfacade/dte/helpers/CreationTimeHelper.java@ 507

Last change on this file since 507 was 507, checked in by George Lilly, 15 years ago

NHIN gateway and adaptor for use on linux with VistA EHR and RPMS

File size: 948 bytes
Line 
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package gov.hhs.fha.nhinc.common.patientcorrelationfacade.dte.helpers;
7
8import org.hl7.v3.TSExplicit;
9import java.util.Calendar;
10import java.text.SimpleDateFormat;
11import java.util.Date;
12
13/**
14 *
15 * @author rayj
16 */
17public class CreationTimeHelper {
18 public static final String DateFormat = "yyyyMMDDhhmmss";
19 public static TSExplicit getCreationTime() {
20 TSExplicit time = new TSExplicit();
21 String formattedTime;
22 try {
23 Calendar cal = Calendar.getInstance();
24 Date now = new Date();
25 String dateString = now.toString();
26 SimpleDateFormat sdf = new SimpleDateFormat(DateFormat);
27
28 formattedTime = sdf.format(now);
29 time.setValue(formattedTime);
30 } catch (Exception ex) {
31 System.out.print(ex);
32 }
33
34 return time;
35 }
36
37}
Note: See TracBrowser for help on using the repository browser.