Millennials have one of the most important things in investing on their side: time. 

By starting to invest long before retirement, millennials can take a very long-term view of their investments. And at The Motley Fool, a long-term view is what we're all about. With that in mind, here are five stocks that are attractive for any millennial's portfolio. 

Millennials at lunch

Image source: Getty Images.

Square

One of the broad trends I think we can expect to continue for decades to come is a growing number of mobile transactions. Square Inc (SQ -0.83%) is a leader in mobile transactions for businesses, and with Square Cash has become a leader in peer-to-peer transactions as well. 

Square is losing money today, but the company is growing like crazy and margins are starting to improve, as you can see below. 

SQ Revenue (TTM) Chart

SQ Revenue (TTM) data by YCharts

The great thing about Square is that it's building a business that will be the foundation on which thousands of other small businesses will be built. With payment processing, point of sale solutions, payroll, and other offerings Square is making it easier to build a business and operate it on mobile platforms, something millennials probably interact with on a regular basis. 

Whole Foods

Millennials didn't start the organic food trend, but they're taking it to a new level. It isn't necessarily that they want food to be healthier than other generations have, but how food is made and what's in it is more important to millennials than ever before. That's been a big driver of Whole Foods' (WFM) success over the past decade, something that I think will continue as millennials get older and more start buying their own groceries.

It's true that Whole Foods' stock price has dipped over the past year as growth has slowed and profits sank. But the fall in the stock price means shares trade at a much more reasonable 20x earnings than the ratio's peak in the 60s a few years ago. 

WFM Chart

WFM data by YCharts

What Whole Foods is riding is a long-term trend toward food that's more transparent and more humanely produced than previous generations have demanded. It's no longer the only player in the market, but it's still the biggest fish, and is uniquely positioned to become a go-to grocery store for millions of millennials for decades to come. 

General Motors

Tesla Motors (TSLA -0.12%) may be the easy auto pick for millennial investors, but General Motors (GM 0.60%) is the better investment long-term. Not only has GM generated more than twice as much net income over the past year ($13.9 billion) as Tesla generated in revenue ($5.9 billion) -- in some ways, it's ahead of the EV upstart on technology. 

GM bought a 9% stake in ride sharing company Lyft in 2016 and recently bought Cruise Automation to advance its self-driving car technology as well. So GM is already ahead of Tesla in the ride sharing business, and is arguably on equal footing in self driving technology.

Where GM has really jumped ahead of competitors is with the Chevy Bolt. The all-electric EV with a 238 mile range and price tag under $30,000 (after the federal tax credit) beat Tesla's Model 3 to the road and will likely have about a year head start in deliveries. 

It may be exciting to talk about Tesla as a future power in the auto industry, but GM is far more established and is executing on a strategic shift that will make the company relevant for decades to come. For long-term investors, that's where I would put my money today. 

SunPower

If there's one trend that will change the world more than any other during the lifetime of millennials, I think it's solar energy. Fossil fuels have long powered everything from our homes to our cars, but it's energy from the sun that's actually our most abundant energy resource, providing the earth with enough energy every hour to provide all of the world's energy consumption needs for an entire year. 

SunPower (SPWR -0.66%) is the most efficient solar panel manufacturer in the world, and has exposure to nearly every segment of the solar market around the world. Everything from small, handheld solar cells to the largest power plants in the world are powered by SunPower solar cells, and that gives the company a unique position from which to grow into the multi-trillion dollar energy market. 

What's encouraging for millennials buying now is that the growth is just beginning. Subsidies no longer drive the adoption of solar energy, with SunPower winning bids in Chile, Mexico, and Nevada that provide cost efficient energy more cheaply than fossil fuels. And with falling costs we will see volumes grow long-term. This is a volatile market, but if you have a decade or two to wait, SunPower is well positioned to take advantage of the booming solar market. 

Nike

Consciousness about health and fitness is almost a standard among millennials today. Whether it's biking to work or taking yoga classes, athletic gear is going to be a staple for the entire generation. And Nike (NKE 0.10%) is a company that's proven to have staying power in the athletics business. 

Nike has proven its ability to stay relevant as styles have changed, but it's their sales model that I think demonstrates why they're built to last. Sure, you can buy Nike products from most retailers, but the company is a master at dealing directly with customers through digital marketing and direct online sales. This cuts out all middlemen and will lead to more information on what customers want and higher profits long-term. And as you build your portfolio, that's a great trend to be following in retail.