Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Shwarup
Posts: 93
Registered: ‎08-18-2011
My Device: 9550
Accepted Solution

How to get Application Build Date and Time?

Hi Guys,

 

 

I am developing application in Cascade.

 

What is the API i can use to get Application Build Date and Tiime?

 

 

 

Thanks,

Shwarup Biswas
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: How to get Application Build Date and Time?

you can use preprocessor directives __DATE__ and __TIME__

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: How to get Application Build Date and Time?

[ Edited ]

I think the best the apis can do is the use of the platform service api's and read the file info...

 

http://developer.blackberry.com/cascades/reference/platform_info.html

 

But the best I think you'll get from that is the datetime it was installed on the device.

 

What are you trying to do?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Shwarup
Posts: 93
Registered: ‎08-18-2011
My Device: 9550

Re: How to get Application Build Date and Time?

I need to get the application build Date and Time not when it is installed on the device.
Thanks,

Shwarup Biswas
Developer
Shwarup
Posts: 93
Registered: ‎08-18-2011
My Device: 9550

Re: How to get Application Build Date and Time?

Hi BGmot,

 

How to use this preorocessor command. could you give me an example?

Thanks,

Shwarup Biswas
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: How to get Application Build Date and Time?

These macros are extended to C-strings at compilation time. It's up to you how/where to use them. As an example following would work I think:

fprintf(stderr, "build date is %s, build time is %s\n", __DATE__, __TIME__);

Developer
Shwarup
Posts: 93
Registered: ‎08-18-2011
My Device: 9550

Re: How to get Application Build Date and Time?

Thank you so much for this example. It works but not returning date.

i got an out put like bellow: 15:52:59
Thanks,

Shwarup Biswas
Developer
Shwarup
Posts: 93
Registered: ‎08-18-2011
My Device: 9550

Re: How to get Application Build Date and Time?

Its working. Thanks
Thanks,

Shwarup Biswas
Developer
ondrejandrej
Posts: 81
Registered: ‎03-17-2013
My Device: Dev Alpha + Z10

Re: How to get Application Build Date and Time?

 

What about QML? Do I have to use setContextProperty() to set the variables from C++?


SQL Terminal – command-line interface to local SQLite database