• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Return metadata cdbDatCreated
#1
I would like to return the value  in the cdbDateCreated metadata (e.g., "Sun, Oct. 27, 2019 4:06:00 PM").  I know that it is a subkey. How would I do this?

Thanks!
  Reply
#2
(11-24-2019, 12:49 PM)JereMiami Wrote: I would like to return the value  in the cdbDateCreated metadata (e.g., "Sun, Oct. 27, 2019 4:06:00 PM").  I know that it is a subkey. How would I do this?

Thanks!

Hi, AFAIK there is no way to do it. I have a similar need and submitted a suggestion that can be seen here https://forums.livecloud.io/showthread.p...ght=metada
To ";" or not to ";" that is the question
  Reply
#3
Hi JereMiami,

Assuming you have the recordID of the record in tRecordID and the table name in tTableName you can do the following:


Code:
put cdb_read(tTableName, tRecordID, "cloud") into tOutputA
put tOutputA[tRecordID]["cdb"]["cdbDateCreated"] into tDateCreated


tDateCreated will contain the value you want
  Reply
#4
One thing to keep in mind is that the timing metadata is stored in seconds. Thus, you will need to convert it into a format that is more human-friendly. As an example:



Code:
convert tDateCreated to internet date

Output would be:  Mon, 25 Nov 2019 10:26:59 -0800

Look up 'convert' in the LiveCode dictionary for other time formats.
  Reply
#5
(11-25-2019, 04:57 PM)simon.schvartzman Wrote:
(11-24-2019, 12:49 PM)JereMiami Wrote: I would like to return the value  in the cdbDateCreated metadata (e.g., "Sun, Oct. 27, 2019 4:06:00 PM").  I know that it is a subkey. How would I do this?

Thanks!

Hi, AFAIK there is no way to do it. I have a similar need and submitted a suggestion that can be seen here https://forums.livecloud.io/showthread.p...ght=metada

The export API for JSON is able to provide the metadata. But, there are other ways to get to your data. As Efrain proposes, your cdb_read will download the entire record, including the metadata. The query API has an option to provide the whole record as output as well. Keep in mind that the times are stored in seconds for a variety of positive reasons; they take up less space, can be sorted numerically, and are easier to compare times against each other.
  Reply
#6
(11-25-2019, 05:40 PM)efrain.c Wrote: Hi JereMiami,

Assuming you have the recordID of the record in tRecordID and the table name in tTableName you can do the following:


Code:
put cdb_read(tTableName, tRecordID, "cloud") into tOutputA
put tOutputA[tRecordID]["cdb"]["cdbDateCreated"] into tDateCreated


tDateCreated will contain the value you want

Thanks! I also was able to retrieve the date created metadata and convert it into a date and time format using:


put cdb_lookUpValue(table, tLine, "cdb", "cloud") into tTempHolder
combine tTempHolder using return
put line 2 of tTempHolderinto tHolder
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)