Dina Kleper
Dina Kleper

Reputation: 2061

Cannot resolve symbol 'DateTime'

I'm trying to use DateTime for the first time.

I'm working with Java on IntelliJ.

I've tried writing:

DateTime dt = new DateTime();

but I get a "Cannot resolve symbol DateTime" error.

What should I do?

Upvotes: 2

Views: 12493

Answers (1)

scadge
scadge

Reputation: 9733

You should import this class, add the following line in the beginning:

import org.joda.time.DateTime;

Note also that JodaTime library should be somehow available to your code, either manually connected as a jar or linked through Maven or other dependency management tool.

Upvotes: 5

Related Questions