function s = ptstr(sec, tzs)
% PTSTR - Geneartes a string of the current time in the Pacific Time zone
%         Handles figuring out PDT / PST.
%
% Use as: s = ptstr(sec) 	% For time string at Unix seconds
%     or: s = ptstr		% For current time
%     or: s = ptstr(sec, tzs)	% For time string at Unix seconds with local Time Zone String appended
%
% $Id: localstr.m,v 1.1 2006/04/11 20:37:38 ssdsadmin Exp $

tz = java.util.TimeZone.getTimeZone('America/Los_Angeles');
c = java.util.GregorianCalendar(tz);

if (exist('sec', 'var')) 
	d = java.util.Date(1000*sec);
	c.setTime(d);
else 
	d = java.util.Date;
	c.setTime(d);
end

Y = c.get(c.YEAR);
M = c.get(c.MONTH) + 1;
D = c.get(c.DAY_OF_MONTH);
h = c.get(c.HOUR_OF_DAY);
m = c.get(c.MINUTE);
s = c.get(c.SECOND);

%%tzstr = java.util.TimeZone.getDisplayName();
tzstr = 'NYS';
localf = java.text.SimpleDateFormat('z');

if (exist('tzs', 'var')) 
	tzstr = char(localf.format(d));
else
	tzstr = '';
end

s = sprintf('%02i/%02i/%04i %02i:%02i %s', M, D, Y, h, m, tzstr);
