Question

Which of these do you think are the best names for date fields?

createdOn/updatedOn createdDate/updatedDate creationDate/updatationDate

Other options? Thank you!

Was it helpful?

Solution

I realized some go better with "_On", like "createdOn" and "updatedOn", while others go better with "_Date", like "startDate", "endDate", "dueDate", etc.

OTHER TIPS

That depends on the sort of date field, where you use the field for. I usually use creationDate or createdOn.

It really depends on the platform, language, environment, etc.

You might just use Created or Updated. After all, you probably wouldn't qualify other field names like NameString or LengthInteger.

One convention I do use sometimes is to qualify date fields for what their values represent. For example, some database types like datetime in MS SQL Server don't track what type of date you are working with. Since many people store UTC values in these fields, you might call the field CreatedUTC to give the developer some clue about what type of value is in there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top