Hi All
I have random number(Integer) which includes date and time .Now I want to convert it into date and time format.
Please suggest.
Thanks
Hari
Hi All
I have random number(Integer) which includes date and time .Now I want to convert it into date and time format.
Please suggest.
Thanks
Hari
Please explain what you mean by “includes date and time”. Also, what’s you version of AX? (Please always attach a tag with your version, such as AX 2012, when creating a new thread.)
Hi Martin,
Thanks for Reply.
We are working on AX 2012, I have random number which is integer value, I have to convert it into date and time
Please suggest.
Thanks in Advance
Hari
Okay, this didn’t work. Let’s try it differently…
Please tell us what you’re trying to achieve. For example, is your actually goal generating random dates in a certain interval? That’s a very different and much more concrete question.
import numpy as np
import pandas as pd
data = pd.DataFrame([[1,3,3],[2,3,1],[1,3,4]],columns=[‘C1’,‘C2’,‘C3’])
data[‘X’] = np.random.choice(len(data), len(data), replace=False)
data[‘date’] = pd.to_datetime(data[‘X’], unit=‘D’)
yields (something like)
C1 C2 C3 X date
0 1 3 3 2 1970-01-03
1 2 3 1 0 1970-01-01
2 1 3 4 1 1970-01-02
np.random.choice with replace=False will guarantee that there are no duplicates.
The snippet you copied from StackOverflow is written in Python, which isn’t usable in Dynamics AX.
Hi Martin
I got it in different way…with completely different requirement .
Sorry for the inconvenience.
Thanks
Hari
if u got different way means share here every body will know don’t put full stop with u