currdatetime() not working

  

Hi,


I try to implement currdatetime() in the assign statement to fetch a user comment time stamp. However, it does not show the current date and time in which the user has input the comment. It shows something really weird. 


Please refer to the screenshot in the attachment. 

Hi,

That 1900-01-01 is the default/empty value of a date. That means you aren't saving any value on that variable. Look into your code and make sure you are assign currdatetime() to the variable before saving it to the database

Regards,

Marcelo


Agree,

That date is equal with nulldate() in outsystems. The drawback is that when you have legacy system that needs that date column to be exactly null (null as known in every DB) - say when migrate from that legacy one to Outsystems -  then you must put more efforts to convert that OS nulldate.

regards 

Hi Sovanreach,

1900-01-01 is null date in Outsystems, It means date not saved in DB please check the code from where you are saving the CurrDateTime() in DB.


Regards

-SK-


Hi,


Can you upload here a print of your code in the action that you use to submit the comment? Maybe your not assign correctly the attribute that you want.

Thanks!


Best regards,

Ricardo

Hi guys, 

Thank you for responses. Here is my code :

MovieComment.UserId = GetUserId()

MovieComment.MovieId = MovieId

MovieComment.TimeStamp = CurrDateTime()


I have checked carefully and I think that the system function currdatetime() might not be working. I am using platform version 11.0. 

What do u guys think?



Solution

Have you shure that "MovieComment.TimeStamp" type is DateTime?

Solution

Hi,

CurrDateTime() is working (at least on my environment). Is something else in your code. It can be on the save. The aggregate that get the value from the database. or in the expression you use on the screen to show the date. Can you share the espace so we can take a look?

Regards,

Marcelo

Hi Sovanreach,

Could you please check the code written in your expression. If by mistake you have mentioned "NullDate()" in expression that's why it is displaying like this. Your code in expression should be -> 

Thank you all. The problem has bee solved. It was a silly mistake. I set the MovieComment.TimeStamp type as time instead of Date Time.



I'm glad that you can move on!


Best regards Sovanreach!

Marcelo Ferreira wrote:

Hi,

CurrDateTime() is working (at least on my environment). Is something else in your code. It can be on the save. The aggregate that get the value from the database. or in the expression you use on the screen to show the date. Can you share the espace so we can take a look?

Regards,

Marcelo

May I ask how to share the espace? I have never used it before .


Hi Sovanreach,

Simply press Ctrl+s in service studio and save your OML. Then after saving it in your system, you can share it anywhere.




Pravi Gupta wrote:

Hi Sovanreach,

Simply press Ctrl+s in service studio and save your OML. Then after saving it in your system, you can share it anywhere.





Cool, thanks for sharing. :)