cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

re: DST (Daylight Savings Time) update please----summary

Highlighted
Alexandrite

re: DST (Daylight Savings Time) update please----summary

Very abbreviated summary:
It looks like there are at least several people that have applied the updates, as I now have as well.
It's fairly lackluster with little really defined message saying that all is well and good and I can sleep in Sunday morning.
I'm happy that nothing broke with the given patches, just disappointed that I don't see any real guarantee that I can sleep soundly through the new DST knowing that I have a happy Ilink server.
Special thanks to Gerry for adding his method for applying patches to his clients.
I used Landesk to run batch files.

Thanks all!

Josh Houser
Pelco
2 REPLIES 2

re: DST (Daylight Savings Time) update please----summary


import com.ptc.intralink.client.script.*;
import com.ptc.intralink.script.*;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import javax.swing.JOptionPane;


public class ILinkDateTest extends ILIntralinkScript {

public ILinkDateTest () { }


// Handle command line execution
//
public static void main ( String[] args ) {
ILinkDateTest obj = new ILinkDateTest();
if (args.length == 0) {
String[] datetimeData = obj.getDate();
if (datetimeData != null) { obj.displayDateInfo(datetimeData); }
}
else {
obj.displayDateInfo(args);
}
System.exit(0);
}


// Handle execution from Intralink GUI
//
public void run() {
String[] datetimeData = getDate();
if (datetimeData != null) { displayDateInfo(datetimeData); }
}


// Prompt user with dialog box
//
public String[] getDate () {

String dateStr = JOptionPane.showInputDialog(
"Enter date (year,month,day,hour,min,sec) separated by spaces: \n"
+ " Enter: 2007 03 11 8 35 01\n"
+ " For: March 11, 2007 08:35:01 AM\n",
"2007 03 11 8 35 01"
);
if (dateStr == null) {
return null;
}

return dateStr.split( "\\s+" );
}


// Display date info in another dialog box
//
public void displayDateInfo ( String[] data ) {

int year=2007, month=0, day=1, hour=0, min=0, sec=0;
String output = null;

try {
year = Integer.parseInt(data[0]);
month = Integer.parseInt(data[1])-1;
day = Integer.parseInt(data[2]);
hour = Integer.parseInt(data[3]);
min = Integer.parseInt(data[4]);
sec = Integer.parseInt(data[5]);
}
catch (Exception e) {
// some exception thrown. probably bad data, or not enough data
// ignore, default values will be used.
}

GregorianCalendar cal = new GregorianCalendar(year,month,day,hour,min,sec);
Date d = cal.getTime();
TimeZone tz = cal.getTimeZone();

String input = ";
for (int i=0; i<data.length; i++)=" {<br="/> input += data[i] + " ";
}

output = "You entered: " + input + "\n"
+ "Date/Time: " + d + "\n"
+ "TimeZone: " + tz.getDisplayName() + "\n"
+ "inDaylightTime: " + tz.inDaylightTime(d);

JOptionPane.showMessageDialog( null, output, "Date Info", JOptionPane.INFORMATION_MESSAGE );

}


}

re: DST (Daylight Savings Time) update please----summary

Code was screwed up by Lyris. Here's another attempt...

Contents of ILinkDateTest.java:

import com.ptc.intralink.client.script.*;
import com.ptc.intralink.script.*;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import javax.swing.JOptionPane;


public class ILinkDateTest extends ILIntralinkScript {

public ILinkDateTest () { }


// Handle command line execution
//
public static void main ( String[] args ) {
ILinkDateTest obj = new ILinkDateTest();
if (args.length == 0) {
String[] datetimeData = obj.getDate();
if (datetimeData != null) {
obj.displayDateInfo(datetimeData);
}
}
else {
obj.displayDateInfo(args);
}
System.exit(0);
}


// Handle execution from Intralink GUI
//
public void run() {
String[] datetimeData = getDate();
if (datetimeData != null) {
displayDateInfo(datetimeData);
}
}


// Prompt user with dialog box
//
public String[] getDate () {

String dateStr = JOptionPane.showInputDialog(
"Enter date (year,month,day,hour,min,sec) "
+ "separated by spaces: \n"
+ " Enter: 2007 03 11 8 35 01\n"
+ " For: March 11, 2007 08:35:01 AM\n",
"2007 03 11 8 35 01"
);
if (dateStr == null) {
return null;
}

return dateStr.split( "\\s+" );
}


// Display date info in another dialog box
//
public void displayDateInfo ( String[] data ) {

int year=2007, month=0, day=1, hour=0, min=0, sec=0;
String output = null;

try {
year = Integer.parseInt(data[0]);
month = Integer.parseInt(data[1])-1;
day = Integer.parseInt(data[2]);
hour = Integer.parseInt(data[3]);
min = Integer.parseInt(data[4]);
sec = Integer.parseInt(data[5]);
}
catch (Exception e) {
// some exception thrown. probably bad data, or not
// enough data. ignore, default values will be used.
}

GregorianCalendar cal =
new GregorianCalendar(year,month,day,hour,min,sec);
Date d = cal.getTime();
TimeZone tz = cal.getTimeZone();

String input = ";
for (int i=0; i<data.length; i++)=" {<br="/> input += data[i] + " ";
}

output = "You entered: " + input + "\n"
+ "Date/Time: " + d + "\n"
+ "TimeZone: " + tz.getDisplayName() + "\n"
+ "inDaylightTime: " + tz.inDaylightTime(d);

JOptionPane.showMessageDialog(
null, output, "Date Info",
JOptionPane.INFORMATION_MESSAGE
);

}


}