Initializing Timestamp attribute // Date format MMMM

If you think that something doesn't work in Aware IM post your message here
Post Reply
pixerp
Posts: 180
Joined: Sun Jan 28, 2007 7:12 pm

Initializing Timestamp attribute // Date format MMMM

Post by pixerp »

1) Timestamp attribute

Using function AS_TIMESTAMP to set a specific initial value to a timestamp attribute doesn't work.

The log says: "Value was not changed because it was equal to the old value: null"

2) Date format MMMM (month name)

Defining a date attribute with format dd MMMM YYYY brings Error: invalid date format.

I'm sending a bsv to support.
Build 1246 - Windows/Mysql
himanshu
Posts: 725
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Post by himanshu »

i also get the same issue,

as this format is used while entering CARD EXPIRY dates, in which day is not required only month and year.



Thanks
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

pixerp,

#1 -- use function: CURRENT_TIMESTAMP

#2 -- use: dd MMMM yyyy

FYI -- a previous post pointed to this:
http://java.sun.com/j2se/1.4.2/docs/api ... ormat.html
Tom - V8.8 build 3137 - MySql / PostGres
himanshu
Posts: 725
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Post by himanshu »

Hi Tom,

pixerp is talking on the attribute type on the business object, not using function.

by function it is possible like you suggested.

Thanks
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Himanshu,

Are you talking about #1 or #2. In either case, I don't understand what you are saying.
Tom - V8.8 build 3137 - MySql / PostGres
BobK
Posts: 546
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

Pixerp,

Could you post how you are trying to use AS_TIMESTAMP.

I have been using it with no problems.
Bob
himanshu
Posts: 725
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Post by himanshu »

Hi Tom,

sorry, you are right with the solution, actually i post something else,

my problem is niether #1 nor #2.

with the function and format it is ok.

but like when we create a new attribute with timestamp or date type, we not able to format in this way MM YYYY.

As this is required when we have to enter only month and year.

Did you got it what i mean.
Thanks
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

With dates and timestamps, capitalization is critical.

They MUST be consistent with the formats you see in the date & timestamp format drop-downs in the config tool.

In your case, MM yyyy should work fine.
Tom - V8.8 build 3137 - MySql / PostGres
pixerp
Posts: 180
Joined: Sun Jan 28, 2007 7:12 pm

Post by pixerp »

Timestamp

Setting the attribute initial value with CURRENT_TIMESTAMP was ok.

The problem was setting an initial value sometime in the past. I tried to define a BO rule like "If BO1.myTimestamp IS UNDEFINED Then BO1.myTimestamp=AS_TIMESTAMP('2000-01-01 00:00','YYYY-MM-dd HH:mm')" or "If BO1 IS NEW Then ..."

NOW I notice the small caps for yyyy as per Tom's post. AND THIS WORKS.

Date with month name

I checked the format and it's dd MMMM yyyy indeed. The error is a screen popup "Attribute has invalid format".

Seems like a bug ? In my test bsv I'm not using any locale.

Thanks
Build 1246 - Windows/Mysql
himanshu
Posts: 725
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Post by himanshu »

Hi,

Try this

<<CURRENT_DATE, EEE dd MMMM yyyy>>
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Post Reply