I'm running WM5 on a Treo 700wx and I'm trying to make my own little app, using Mortscript, to display the date on the carrier logo field. I've gotten as far as using:
Code:
GetTime dat, "m d, Y"
which will display in the format of
Code:
04 04, 2007
I would like to display the day name and the month name also, so it would look like this...
Code:
Wednesday, April 04, 2007
I figured out how to write the info into the carrier logo field, except I can't figure out how to retrieve and display the day name and month name.
So can I get some help please?
Thank you.
I figured it out. In the current release of Mortscript, the month can only be retrieved in numerical format. The day of week is the same. So I created a routine that will do the following:
if Week = 0 then WeekDay=Sunday
The month is also retrieved by a similar method:
if Month = 1 then MonthName=January
crazie.eddie said:
I'm running WM5 on a Treo 700wx and I'm trying to make my own little app, using Mortscript, to display the date on the carrier logo field. I've gotten as far as using:
Code:
GetTime dat, "m d, Y"
which will display in the format of
Code:
04 04, 2007
I would like to display the day name and the month name also, so it would look like this...
Code:
Wednesday, April 04, 2007
I figured out how to write the info into the carrier logo field, except I can't figure out how to retrieve and display the day name and month name.
So can I get some help please?
Thank you.
Click to expand...
Click to collapse
have you tried GetTime dat, "dddd, MMMM dd, YYYY"
Related
This registry hack probably applies to other models as well as the Universal.
By default, the working-week Days and Hours shown in Pocket Outlook by a different colour are set to Monday through Friday and 08:00 to 17:00-hrs. I needed a modification for a client with a weird working week (Mon, Wed, Fri, Sat) and starting ending times on the half hour. The following hack allows this:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Calendar\ActiveTimes]
"ActiveTimes"=dword:2210003E
If whole key is missing, or as above, sets default of 8:00 to 17:00hrs with working week of Monday through Friday.
Explanation:
A. Starting and Ending times of working week (3rd & 4th bytes of dword value)
Specified as a hex value in left-most two bytes.
Format is: eessxxxx e.g.: 2313xxxx
(ee) Left-most byte is Ending time in half hour units
i.e.: 23-hex = 35d/2 = 17.5 = 17:30hrs
(ss) Right-most byte is Starting time in half hour units
i.e.: 13-hex = 19d/2 = 9.5 = 09:30hrs
So, to set 9:30 to 18:30, Mon through Fri use:
"ActiveTimes"=dword:2313003E
B. Particular Days of Working week (1st byte of dword value)
Specified as a binary value in rightmost byte.
Format is: xSFTWTMS
i.e.: x,Sat,Fri,Thu,Wed,Tue,Mon,Sun
e.g.: default value (3E-hex) is: x0111110 = Fri,Thu,Wed,Tue,Mon
e.g.: use 7E-hex for a 6-day (Mon to Sat) working week: x1111110
e.g.: use 16-hex for 3-day working week (Tue, Thu, Fri): x0110100
Don't know if the leftmost bit is used for anything.
So to set working week of 9:30 to 18:30, Mon to Sat, use:
"ActiveTimes"=dword:2313007E
how i can do if my workday start at 10:00 and ends at 00:00 ?
zpdy said:
how i can do if my workday start at 10:00 and ends at 00:00 ?
Click to expand...
Click to collapse
Okay, you've got me on this one! The best that I can do is 10:00 to 23:30, so you'll have to sweet-talk your boss into letting you leave work half-an-hour early :wink:
Unfortunately, the ending value cannot accept 24:00-hrs, neither can it accept 00:00-hrs; since the ending time must be greater than the starting time. If you try, it reverts to 8:00 to 17:00.
I'm assuming that your working days are Monday to Friday, so for 10:00 to 23:30, you'll need to insert a value of: 2F14003E
How is this calculated?
Well, a starting time of 10:00 = 20 half-hour units, which in hexadecimal notation is 14
The ending time of 23:30 = 47 half-hour units, which in hexadecimal is 2F.
The working days (Monday through Friday) are defined by the byte 3E - as detailed in the first message in this topic.
I have not yet experimented to see if the second byte has any influence on the calendar.
As for the clever **** that wanted different days every other week :shock:, either write your own calendar or apply once of two .REG files as needed. :lol:
Didn't work on mine.
I got a problem with my calendar application, it uses a date format that's neither the long (17. October 2007) nor the short version (17.10.2007). Instead it uses a format with Roman numerals for month number, like 17. X 2007. The calendar app can't change this, it simply takes it from the OS, so is it possible to change it somehow, maybe in the registry?
Try using strftime (if you're using ANSI C) or GetDateFormat (Windows API). Changing the registry values will work, too, but that may change the way other apps present the date, which may not be what you want.
Relatively new to this forum, but I've written a little app for WM6 and I'm trying to get "selected icon" functionality working.
I've been looking around and the general consensus on .lnk syntax is something like the following...
xx#<path>[options]
...where xx is the number of characters to consider as the command line after the pound sign.
If that's the case, what does this format for the calendar shortcut on my device mean?
21#:MSCALENDAR?:calendarapp
The 21 doesn't seem to refer to anything, as there are 24 characters after the pound. And what is ":MSCALENDAR?:" ? Is that some sort of environment variable? If so, where is it defined?
I did finally figure out that "calendarapp" refers to HKCR\calendarapp, where both the "DefaultIcon" and "SelectIcon" keys are defined, but there's no reference to the calendar app's path, so that must be defined by :MSCALENDAR?: somehow.
Thanks for any pointers!
wdbdesign said:
Relatively new to this forum, but I've written a little app for WM6 and I'm trying to get "selected icon" functionality working.
I've been looking around and the general consensus on .lnk syntax is something like the following...
xx#<path>[options]
...where xx is the number of characters to consider as the command line after the pound sign.
If that's the case, what does this format for the calendar shortcut on my device mean?
21#:MSCALENDAR?:calendarapp
The 21 doesn't seem to refer to anything, as there are 24 characters after the pound. And what is ":MSCALENDAR?:" ? Is that some sort of environment variable? If so, where is it defined?
I did finally figure out that "calendarapp" refers to HKCR\calendarapp, where both the "DefaultIcon" and "SelectIcon" keys are defined, but there's no reference to the calendar app's path, so that must be defined by :MSCALENDAR?: somehow.
Thanks for any pointers!
Click to expand...
Click to collapse
:MSCALENDAR:, as well as :MSCONTACTS: and many others are aliases!
SKTools can help manage those and even define new ones!
Ah...thanks for that! Armed with that information I was able to discover that those are stored in HKLM/Software/Microsoft/Shell/Rai. Exactly what I was looking for!
Im using the java.sql.Date function to generate a Date from a DatePicker. Im having to take off 1900 from the Year after before the Date is generated for some odd reason, but never mind. I presume it's based on years AFTER 1900 and expecting a two digit date to be passed. I wonder how that'll work with the 1800's...
Anyhoo, I've seen the recommendations to use "Calendar" instead, but what I haven't quite figured out, is how you then get the date from the Calendar to format it in a variety of styles.
The simplest thing seems to be
Code:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
StringDate = sdf.format(date);
Or where I want to format a Date according to the System Locale:
Code:
java.text.DateFormat df = DateFormat.getDateFormat(context);
StringDate = df.getDateInstance().format(Date.valueOf(date));
Are these all the correct ways of formatting dates, or should I be using Calendar?
Thanks
Simon
just in case any of the actually coding people stopping by here,
i want to ask:
is it possible to implement a correct standard date format in PAC-ROM?
if one really cant figure it out, by 'correct standard' i mean:
http://en.wikipedia.org/wiki/Date_and_time_representation_by_country#ISO_8601 said:
International standard ISO 8601 (Representation of dates and times) defines unambiguous written all-numeric big-endian formats for dates, such as 1999-12-31 for 31 December 1999, and time, such as 23:59:58 for 23 hours, 59 minutes, and 58 seconds.
These standard notations have been adopted by many countries as a national standard, e.g., BS EN 28601 in the UK and similarly in other EU countries, ANSI INCITS 30-1997 (R2008), and FIPS PUB 4-2 in the United States (FIPS PUB 4-2 withdrawn in United States 2008-09-02).[1] They are, in particular, increasingly widely used in computer applications, since the most to least significant digit order provides a simple method to order and sort time readings.
Click to expand...
Click to collapse
some historical information:
http://en.wikipedia.org/wiki/ISO_8601#History said:
History
The first edition of the ISO 8601 standard was published in 1988. It unified and replaced a number of older ISO standards on various aspects of date and time notation: ISO 2014, ISO 2015, ISO 2711, ISO 3307, and ISO 4031.[2] It has been superseded by a second edition in 2000 and by the current third edition published on 3 December 2004. ISO 8601 was prepared by,[3] and is under the direct responsibility of, ISO Technical Committee TC 154.[4]
ISO 2014, though superseded, is the standard that originally introduced the all-numeric date notation in most-to-least-significant order [YYYY]-[MM]-[DD]. The ISO week numbering system was introduced in ISO 2015, and the identification of days by ordinal dates was originally defined in ISO 2711.
Click to expand...
Click to collapse
so since 1988 2015-01-18 is standard and not 2015/01/18 or 2015.01.18
it is quite strange that / and . are available and - is not ...
here are some details:
wiki said:
General principles
Date and time values are ordered from the largest to smallest unit of time: year, month (or week), day, hour, minute, second, and fraction of second. The lexicographical order of the representation thus corresponds to chronological order, except for date representations involving negative years. This allows dates to be naturally sorted by, for example, file systems.
Each date and time value has a fixed number of digits that must be padded with leading zeros.
Representations can be done in one of two formats – a basic format with a minimal number of separators or an extended format with separators added to enhance human readability. The standard notes that "The basic format should be avoided in plain text." The separator used between date values (year, month, week, and day) is the hyphen, while the colon is used as the separator between time values (hours, minutes, and seconds). For example, the 6th day of the 1st month of the year 2009 may be written as "2009-01-06" in the extended format or simply as "20090106" in the basic format without ambiguity.
For reduced precision, any number of values may be dropped from any of the date and time representations, but in the order from the least to the most significant. For example, "2004-05" is a valid ISO 8601 date, which indicates May (the fifth month) 2004. This format will never represent the 5th day of an unspecified month in 2004, nor will it represent a time-span extending from 2004 into 2005.
If necessary for a particular application, the standard supports the addition of a decimal fraction to the smallest time value in the representation.
Click to expand...
Click to collapse
and please dont make it depend on locale!
even if one choses english als gui-language the seperator should stay ISO8601 concurring!
well...
at least i can make some silly posts/topics in this forum...
hm...
any news
where do you see this?
i guess i missed the notification ...
i see it on 4.x on 5.x on 6.x on 7.x ! why is there a standard noone care's about... nothing changed